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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Parameters to Stored Procedure

Author  Topic 

joriveek
Starting Member

33 Posts

Posted - 2006-04-04 : 06:17:47
Hi Team,

I have a stored procedure will be called with two parameters, sometimes, my client calls with only one parameter,
Example:

Exec spAddThreeNumber @a, @b

some times client calls with

Exec spAddThreeNumber @a
(in this case I assume that @b as zero) (how do I do this bit)?

Thanks

chiragkhabaria
Master Smack Fu Yak Hacker

1907 Posts

Posted - 2006-04-04 : 06:21:21
in the procedure set the default value as 0

for eg
Create proc tmp
(
@var int,
@var1 int =0
)
as
begin
-- you code here
end

If Debugging is the process of removing Bugs then i Guess programming should be process of Adding them.
Go to Top of Page
   

- Advertisement -