Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Optional Parameters
Message
From
24/02/2002 13:08:12
 
 
To
24/02/2002 12:48:53
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Miscellaneous
Thread ID:
00624260
Message ID:
00624267
Views:
12
I assume you are talking about it calling it from VFP? If you want to use named parameters to call an SP from VFP you have to use the names in the SP, like:

"EXEC myproc @One=?One, @Three=?Three"

Then, as you said, in the SP you would check to see which parameters are still null which would mean they weren't passed, or they were passed null.

BOb


>I have a quick question about optional parameters in Stored Procedures... is there any way of telling if a named parameter was actually passed to the SP?
>
>Say I have this SP:
>
>CREATE PROCEDURE MyProc
>       @One   char(1) = NULL,
>       @Two   char(2) = NULL,
>       @Three char(3) = NULL
>AS
>   blah, blah, blah
>
>OK, now say I call it like this:
>
>Three = 'abc'
>EXEC MyProc ?Three
>
>In the SP, I know that I can check that values of @One and @Two and since they are both NULL, they may or may not have been passed as parameters, since I may have actually assigned the NULL value to them intentionally:
>
>One   = NULL
>Three = 'abc'
>EXEC MyProc ?One, ?Three
>
>In this second case ... is there anyway to tell that @One was passed as a parameter, but @Two was not?
>
>TIA,
>~~Bonnie
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform