Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Executing SQL Agent Job Remotely


Executing SQL Agent Job Remotely

Author
Message
Bajrang
Bajrang
Say Hey Kid
Say Hey Kid (692 reputation)Say Hey Kid (692 reputation)Say Hey Kid (692 reputation)Say Hey Kid (692 reputation)Say Hey Kid (692 reputation)Say Hey Kid (692 reputation)Say Hey Kid (692 reputation)Say Hey Kid (692 reputation)

Group: General Forum Members
Points: 692 Visits: 248
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
Gianluca Sartori
Gianluca Sartori
SSCertifiable
SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)

Group: General Forum Members
Points: 6834 Visits: 13323
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
Bajrang
Bajrang
Say Hey Kid
Say Hey Kid (692 reputation)Say Hey Kid (692 reputation)Say Hey Kid (692 reputation)Say Hey Kid (692 reputation)Say Hey Kid (692 reputation)Say Hey Kid (692 reputation)Say Hey Kid (692 reputation)Say Hey Kid (692 reputation)

Group: General Forum Members
Points: 692 Visits: 248
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
Gianluca Sartori
Gianluca Sartori
SSCertifiable
SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)

Group: General Forum Members
Points: 6834 Visits: 13323
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
Gianluca Sartori
Gianluca Sartori
SSCertifiable
SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)

Group: General Forum Members
Points: 6834 Visits: 13323
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
Bajrang
Bajrang
Say Hey Kid
Say Hey Kid (692 reputation)Say Hey Kid (692 reputation)Say Hey Kid (692 reputation)Say Hey Kid (692 reputation)Say Hey Kid (692 reputation)Say Hey Kid (692 reputation)Say Hey Kid (692 reputation)Say Hey Kid (692 reputation)

Group: General Forum Members
Points: 692 Visits: 248
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
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search