Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
ya3mro
Starting Member
37 Posts |
Posted - 2006-06-21 : 08:24:48
|
| i want to know if i can make stored procedure have optional parameter ??i mean that SP have a parameter that can be passed or not ??can that br done ?How I Came To Islam? http://english.islamway.com |
|
|
mwjdavidson
Aged Yak Warrior
735 Posts |
Posted - 2006-06-21 : 08:34:27
|
Give it a default value. I.e.:CREATE PROC #myproc (@param INT = NULL)ASSELECT @param-- Return NULL valueEXEC #myproc-- Return 10EXEC #myproc 10 Mark |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-06-21 : 09:11:01
|
| Also note that optional parameters should be declared last in the parameter listsMadhivananFailing to plan is Planning to fail |
 |
|
|
ya3mro
Starting Member
37 Posts |
|
|
|
|
|