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
 General SQL Server Forums
 New to SQL Server Programming
 declare var in sp

Author  Topic 

trento
Starting Member

13 Posts

Posted - 2009-10-12 : 17:01:57
Hi, I work with old sp that has @nextbusinesday var:
( this is as scripted to CREATE):

CREATE PROCEDURE [dbo].[bat_GetCart_03]
@nextBusinessDay datetime --#1
...
select ......
where ......
AND @nextBusinessDay BETWEEN w.ActDate AND w.InActDate --#2
.....

In the first instance #1 does @nextBusinessDay takes actual nextBD value from some system table? E.g. 10/13/2009. I can't find any other assighment for this var anywhere in sp.

Anybody can explain how this works, how @nextbusinessday get any value to check in #2.

Tx
Trent

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2009-10-12 : 17:11:09
The "variable" is actually an input PARAMETER to the procedure. That means that when you execute the procedure the value is passed in by the caller.

EDIT:
an example of the call may be:

exec bat_GetCart_03 @nextBusinessDay = '2009-10-13'

Be One with the Optimizer
TG
Go to Top of Page

trento
Starting Member

13 Posts

Posted - 2009-10-12 : 17:21:53
Thanks TG ! All is in place now.

T
Go to Top of Page
   

- Advertisement -