Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parameter names newbie question
Message
 
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01544332
Message ID:
01544335
Views:
29
>Hi,
>
>(sorry for many newbie questions today). Do names of the parameters defined in a stored procedure have to be the same as names defined in the calling procedure? For example, if I am creating a parameter in a .net method and I name the parameter @cMyParam1, exactly the same name has to be in the stored procedure? E.g.
>
>
>procedure MyProc
>    @cMyParam1 VarChar(20)
>
>
>Or, as in VFP procedure, the name could be anything? TIA.

It depends on how you call the SP. If you use named parameters, they must match. If you simply do
execute MyProc 'Value1', 'Value2'
then you don't specify name, but you must pass all parameters in the correct order even optional ones.

So, I prefer to use named parameters always.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform