sharing out sql agent job to users

Amanda Walshaw
Amanda Walshaw used Ask the Experts™
on
I have Finance Dept wanting to update an sql agent job to get the latest figures. I do not wish to give them the client tools facility or maybe i can with permissions.
what do you recommend?

or can they run a sql script at command level to do it.
IT manager has an issue with giving any users access to sql agent or sql in any form.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
You can create a stored procedure to start the job (using sp_start_job), then give the users execute permission to that SP, which then can be called by any application that can call a SP.

The easy way to do it would be to publish a link on an internal web server, and allow users to use that to run the SP.

Amanda WalshawData Engineer / Business Analyst

Author

Commented:
hmm i am thinking via excel they can run it. 2010 excel
Amanda WalshawData Engineer / Business Analyst

Author

Commented:
I have created under a msdb database on the sever a sp_runjob and tested it.
what about a command line statement to run sp_runjob.
I don;'t think they want this command on an internal web server just yet.
Amanda WalshawData Engineer / Business Analyst

Author

Commented:
I have created the following command


sqlcmd -Q "exec sp_RunJob" -MYSERVER -msdb -E -oC:\Output.txt

i have tried to run it from my pc, and on the server on  a shared folder on C Drive.
its not working I am sure the command is correct.
anyone can shed any light most greatful
Amanda WalshawData Engineer / Business Analyst

Author

Commented:
also trying these as well
osql -E -d MSDB -Q "sp_start_job 'MySQLJob'"

osql -U user1 -P password -d MSDB -Q "sp_start_job 'MySQLJob'"

will give you my results when completed
Amanda WalshawData Engineer / Business Analyst

Author

Commented:

C:\>sprunjob

I have tried the following command
sqlcmd -U user1 -P password -d MSDB -Q "sp_start_job 'MySQLJob'"


C:\>sqlcmd ûsa  ûpassword. ûdMSDB ûQ"dbo.sp_RunJob"
Sqlcmd: 'ûUsa': Unknown Option. Enter '-?' for help.

Ran this straight off the server as a command prompt

secondly ran thsi script again at command prompt from the server on C: Drive

C:\>sqlcmd -Q "exec sp_RunJob" -Server -msdb -E -oC:\Output.txt
Sqlcmd: 'sdb': Unexpected argument. Argument has to be a number greater than or
equal to -1.

C:\>

Can someone show me where I am going wrong. I just want to run a sql stored procedure from a command line.
Amanda WalshawData Engineer / Business Analyst

Author

Commented:
This is what I will do in the future for now got a wmi script working from a command sql

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial