dbTalk Databases Forums  

Passing Arguments to a SQL Server Job

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Passing Arguments to a SQL Server Job in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
John Barr
 
Posts: n/a

Default Passing Arguments to a SQL Server Job - 02-20-2004 , 05:45 PM






I am trying to create an alert that will execute a job and
pass arguments to it to perform certain tasks. Does anyone
know if this is possible?

Reply With Quote
  #2  
Old   
Narayana Vyas Kondreddi
 
Posts: n/a

Default Re: Passing Arguments to a SQL Server Job - 02-20-2004 , 05:55 PM






One way to achieve this would be to write the parameters to a table, and
then kick off the job using sp_start_job. The job step knows where to read
the parameters from, and acts accordingly.
--
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm




"John Barr" <jbarr (AT) toobrands (DOT) com> wrote

I am trying to create an alert that will execute a job and
pass arguments to it to perform certain tasks. Does anyone
know if this is possible?



Reply With Quote
  #3  
Old   
Yuan Shao
 
Posts: n/a

Default RE: Passing Arguments to a SQL Server Job - 02-20-2004 , 10:32 PM



Hi John,

My name is Michael and I would like to thank you for using Microsoft
newsgroup.

As far as I know, it seems there is no way to pass arguments like global
variable mechanism in DTS package. However, you can try to use other ways
to meet your requirements.

For example:
a. Storing the arguments in certain table and using stored procedure to get
them from tables in job.
b. Using VB script in job to get arguments from files or other things.

Thank you for using Microsoft newsgroup.

Regards,

Michael Shao
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.


Reply With Quote
  #4  
Old   
Yuan Shao
 
Posts: n/a

Default RE: Passing Arguments to a SQL Server Job - 03-05-2004 , 02:45 AM



Hi John,

How is the issue going on your side? Please feel free to post in the group
if you need further assistance on this issue. I am happy to be of
assistance.

Based on my further research, unfortunately, I am afraid that SQL Server is
unable to meet your requirements passing a parameter to a job that is
executed in response to an alert. As I have mentioned in my previous
message, you may pass the parameter to a stored procedure that they can
call from within the job but there is no concept of sending a parameter to
a job. A parameter can be passed to a stored procedure or a function and
not to a job.

Thanks for posting in community.

Regards,

Michael Shao
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.