Calll SQL Server Agent Job

Hi Guys,

I want to complete this task but don't know how. Need help!!
I want to give Users to execute SQL AGENT JOB. SQL Agent is running SSIS Package. I was thinking to give some kind of Click Button Access to user so user can execute the SSIS Package/SQL Agent Job,The folder I will create in Network drive and inside the folder could be Excel File to run Macro to call SSIS Package or other option. I would like to know how I can accomplish this task. FYI in user machine SQL SERVER/BIDS are not installed and Users doesn't have permission to sql server.

Please advise.

Thank You.

Sounds like you want to create a program using C# or VB.Net to invoke methods from the SMO Agent namespace. The Job.Start method will trigger a job. You could also run SSIS packages programmatically - see here.

1 Like

Hi Tooba,
If you can using Excel file, you might can use vb script to call out sqlcmd and start a sql job. The bad side is that you will have to keep track of the status since it will return success once the job got started. You will then need to query msdb to check the status of the job.
You will still need to give permission to a given user which will need to code it in the sqlcmd statement in order for it to work.
Rgds,