Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Executing SQL Agent Job Remotely Expand / Collapse
Author
Message
Posted Thursday, June 4, 2009 8:50 AM
Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Wednesday, October 8, 2014 12:45 PM
Points: 670, Visits: 233
Hi,
I need to create a batch file for a user. This batch file will have to execute a Sql agent job on Remote Server.

I am not able to execute SQL Agent job using batch file remotely.
User's machine doesn't have sql server installed and we don't want to install it either.

Is it possible to execute a SQL Agent job from a Batch file out of Remote User's machine where we don't have SQL Server installed???

Thanks in advance.

-RP


-RP
Post #729021
Posted Thursday, June 4, 2009 10:40 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Today @ 10:47 AM
Points: 4,613, Visits: 11,014
You could write a .VBS Script to connect to the server and issue msdb.dbo.sp_start_job @job_name = 'yourjobname'.

Hope this helps
Gianluca


--
Gianluca Sartori

How to post T-SQL questions
spaghettidba.com
@spaghettidba
Post #729135
Posted Thursday, June 4, 2009 10:53 AM
Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Wednesday, October 8, 2014 12:45 PM
Points: 670, Visits: 233
Ya, I can do that using VBS but they don't want it. they want it to be done by .bat or .cmd only.
Is it possible?

Thanks for your reply..

-RP


-RP
Post #729147
Posted Friday, June 5, 2009 1:31 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Today @ 10:47 AM
Points: 4,613, Visits: 11,014
If you can't have a VBS, then you need something able to connect to SQL server and issue queries. One thing that comes to my mind is sqlcmd or osql. You can copy just the .exe to the client machine and then run it with the query as a parameter. I tried that with osql.exe and it worked, without installing anything on the client side.

Hope this helps
Gianluca


--
Gianluca Sartori

How to post T-SQL questions
spaghettidba.com
@spaghettidba
Post #729450
Posted Friday, June 5, 2009 2:39 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Today @ 10:47 AM
Points: 4,613, Visits: 11,014
You're incredibly lucky: take a look at today's articles:

http://www.sqlservercentral.com/articles/SQL+Job/66421/


--
Gianluca Sartori

How to post T-SQL questions
spaghettidba.com
@spaghettidba
Post #729479
Posted Friday, June 5, 2009 8:39 AM
Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Wednesday, October 8, 2014 12:45 PM
Points: 670, Visits: 233
Superb. Excellent.
Thanks a lot for your help, even your post solved my issue, Article has nothing about remote machine without having sql client installed on it.
I copied that OSQL file on user's machine and tried to run it and it worked... "Bole to Jhakaas" means Outstanding in my language.

Thanks for your help again.

-RP


-RP
Post #729783
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse