By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,266 Members | 1,297 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,266 IT Pros & Developers. It's quick & easy.

Default Stored Procedure Parameters

P: n/a
Hello, does anyone know how to determine (within the stored procedure)
whether a parameter has been passed explicitly to a stored procedure as
opposed to a parameter that has taken on the default value.
Many thanks
Phil

Jul 23 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a

<te*******@skunkbox.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Hello, does anyone know how to determine (within the stored procedure)
whether a parameter has been passed explicitly to a stored procedure as
opposed to a parameter that has taken on the default value.
Many thanks
Phil


Not as far as I know. You could add code which compares the initial
parameter values to a list of the defaults, but that wouldn't cover the case
where someone explicitly passes the default value.

Simon
Jul 23 '05 #2

P: n/a
I don't know of a passive way, but you could create another parameter such
as a bool bIsDefault that defaults to TRUE. Then have calling functions pass
a FALSE value to this if they pass any other parameters.

Just a thought.
Cheers!

"Simon Hayes" <sq*@hayes.ch> wrote in message
news:41********@news.bluewin.ch...

<te*******@skunkbox.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Hello, does anyone know how to determine (within the stored procedure)
whether a parameter has been passed explicitly to a stored procedure as
opposed to a parameter that has taken on the default value.
Many thanks
Phil


Not as far as I know. You could add code which compares the initial
parameter values to a list of the defaults, but that wouldn't cover the
case where someone explicitly passes the default value.

Simon

Jul 23 '05 #3

P: n/a
There are no BOOLEAN data types in SQL-92; they would make no sense in
terms of 3VL and NULL rules.

The guy can check the values as they come into the procudure with an IF
statement in the body or with a CASE expression in the SQL.

Jul 23 '05 #4

P: n/a
--CELKO-- (jc*******@earthlink.net) writes:
There are no BOOLEAN data types in SQL-92; they would make no sense in
terms of 3VL and NULL rules.


Don't be silly. In such case neither AND or OR would make sense. Or anything
make sense. Real-world databases are full of boolean values, because
real-world business needs is full of boolean values.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 23 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.