Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is default value always required?
Message
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01446591
Message ID:
01446596
Vues:
47
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--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform