Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is default value always required?
Message
 
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01446591
Message ID:
01446596
Views:
48
Yes, you're correct. Either you have to provide default value for a sproc parameter or you'll have to pass the value in the call.

>
>I need to understand something basic/newbie about stored procedure.
>
>Say I have a named parameter in the stored procedure and then I have INSERT command that inserts a row into a table using this named parameter. For example:
>
>
>INSERT MyTable
>  (MyField)
>   SELECT @MyField
>
>
>The column MyField is set in the table to allow NULL values.
>
>If I don't pass the names parameter @MyField I get error that the stored procedure didn't receive parameter @MyField. So the only way I can make this work is by defining (in the parameter line that the default value is NULL), correct? I think I know that this is the way to go but want to be sure I am not missing something that will bite me later.
>
>TIA.
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform