March 25, 2009 at 6:28 am
hi
I have a situation.I have a job inside of sql server agent services(2008) which executes a stored procedure.The problem is that this stored procedure accepts two parameters.@StartDate datetime,
@EndDate datetime.
Now how do I pass in these parameters?.I am fairly new to creating jobs inside of sql server 2008.
March 25, 2009 at 6:47 am
If you want to know how to pass the parameters to the stored procedure, you do it the exact same way that you would do it if you were working with regulare script/stored procedure (e.g. exec MyProc @MyFirstParam, @MySecondParam). If you want to know how to pass parameters to the job it self – then this is not possible.
Adi
--------------------------------------------------------------
To know how to ask questions and increase the chances of getting asnwers:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
March 25, 2009 at 10:57 am
Hi
What do your start/end parameter depend on? If they are relative to to the current date you can calculate them first and then call the procedure.
Greets
Flo
March 28, 2009 at 1:14 am
[font="Verdana"]Better you place your SProc inside DTS and here you can pass the paramenters runtime to the SProc. Then schedule the DTS.
Mahesh[/font]
MH-09-AM-8694
March 29, 2009 at 11:45 am
This may not be exactly what you're looking for, but you could create a wrapper stored procedure that the job calls. this sproc would do whatever calculation or querying necessary to determine the start & end time parameters, and then pass them to your existing stored procedure.
Regards, Jim C
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply