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
 Old Forums
 CLOSED - General SQL Server
 Passing variables to batch jobs?

Author  Topic 

AGoss
Starting Member

2 Posts

Posted - 2004-03-24 : 17:19:13
Hey gang....

I have a three reports which are currently being called by a batch job. These reports are scheduled to run on a given day each quarter. The individual who receives this information just made a request to be able to run these reports for historical time periods while maintaining the same automated schedule. I have taken care of the coding change I just need a way to feed it the dates the user wants to see the report ran for.

So, what I need to know if there is a way to pass dates to a batch job and then use those dates to pass to the files called by oSQL?


Thanks,

Andy

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-03-24 : 18:14:50
No, you can not do that. Why not run the reports from a UI?

Tara
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2004-03-24 : 18:44:16
What do you mean by a batch job?
If it's a .bat file then you can write the file using sql or use command line parameters and including the dates.
If an agent job then you can get the values from a table within the job - you can also change the command but getting the data from atable is easier.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-03-24 : 18:48:31
I understood it to mean prompt the user for the input parameters of the stored procedure.

Tara
Go to Top of Page

AGoss
Starting Member

2 Posts

Posted - 2004-03-24 : 22:37:25
Actually it is an agent calling a .bat file. So, instead of a table could I use a flat file to read in the dates? This way I could train the user to enter the dates in the flat file and save it in a cetain location. Then she could submit a request to have the job ran manually.

Am I making this harder than it needs to be?

Thanks for your posts,

Andy
Go to Top of Page
   

- Advertisement -