Note that there are some explanatory texts on larger screens.

plurals
  1. POProcedure or function “” expects parameter '', which was not supplied
    text
    copied!<p>I am new to SQL and trying to write a stored procedure. I am having some difficulties to get default values as an output result.</p> <p>I have 2 table:</p> <p><strong>Student_Input</strong>:</p> <pre><code>InputID SectionID ParameterName Sequence ------------------------------------------------ 1 100 FirstName 1 2 100 MiddleName 2 3 100 LastName 3 </code></pre> <p><strong>Student_Input_details</strong>:</p> <pre><code>ParameterName ParameterValue DefaultValue ----------------------------------------------------- FirstName John 1 FirstName Troy 0 FirstName Mark 0 </code></pre> <p>I am trying to call <code>ParameterName</code> from <code>Student_Input</code> and Its default value from <code>Student_Input_Details</code> as an output in one table. I am trying with following query but I am getting following error:</p> <blockquote> <p><em>Msg 201, Level 16, State 4, Procedure Getparameterdefaultvalues, Line 0<br> Procedure or function 'Getparameterdefaultvalues' expects parameter '@ParameterValue', which was not supplied.</em></p> </blockquote> <p>I am sure I am missing something important here. </p> <p>My query is below. I am learning , it may be an easy question. Thx........</p> <pre><code>CREATE PROCEDURE Getparameterdefaultvalues ( @ParameterName varchar(50) , @ParameterValue varchar(50) OUT ) AS BEGIN SELECT @ParameterValue = DefaultValue FROM ParameterInput_Values WHERE ParameterName=@ParameterName END DECLARE @ParameterValue varchar(50) EXEC Getparameterdefaultvalues @ParameterName = 1, @ParameterValue OUTPUT PRINT 'Result is: ' + @ParameterValue </code></pre> <p>I need result like (i.e. <code>ParameterName</code> should only display its default value at runtime):</p> <pre><code>ParameterName ParameterValue ---------------------------------- FirstName John </code></pre> <p>I have tried on other blogs but couldn't resolve this. Apologies If my question is not so cleared. Any help would be great!! Thx </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload