all groups > sql server new users > february 2006 >
You're in the

sql server new users

group:

Optoinal Parm in a Function



Optoinal Parm in a Function Josh
2/16/2006 12:00:00 AM
sql server new users: I've set up an optional parameter on a function, but when I call the
function without a value, it doesn't work. Is this a common problem?

--
#####-----#####-----#####
POV Tips and Hints at ...
http://povman.blogspot.com/

Re: Optoinal Parm in a Function Tom Moreau
2/16/2006 12:00:00 AM
It's by design. If you want the default used, then give it the value of
default:

select * from dbo.MyProc (DEFAULT)

--
Tom

----------------------------------------------------
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
..
[quoted text, click to view]
I've set up an optional parameter on a function, but when I call the
function without a value, it doesn't work. Is this a common problem?

--
#####-----#####-----#####
POV Tips and Hints at ...
http://povman.blogspot.com/

AddThis Social Bookmark Button