Ask a Question

Run a SQL Job from JScript

SOLVED
scmadden
New Contributor

Run a SQL Job from JScript

I need to simply run a SQL Server Agent job. I don't need to return values; it is more of a middle man job. Could I do something like this:

var SJob;

var Sjob.ConnectionString = "all the stuff that goes in here...";

SJob.ProcedureName = "SendJobs";

SJob.ExecProc();

 

Or would I be going about this incorrectly? 

1 ACCEPTED SOLUTION

Accepted Solutions
TanyaYatskovska
Community Manager

Re: Run a SQL Job from JScript

Hi @scmadden,

 

I've found the following example demonstrating how you can call an SQL stored procedure (even with parameters):

https://smartbear-cc.force.com/portal/KbArticleViewer?name=Call-an-SQL-Stored-Procedure

 

 

---------
Tanya Yatskovskaya
SmartBear Community and Education Manager


View solution in original post

4 REPLIES 4
Marsha_R
Community Hero

Re: Run a SQL Job from JScript

What happened when you tried that?


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
scmadden
New Contributor

Re: Run a SQL Job from JScript

Well, I haven't yet. Can't extend my trial either. Should get a license next week. It should work for an actual stored procedure, but this is for a job...

TanyaYatskovska
Community Manager

Re: Run a SQL Job from JScript

Hi @scmadden,

 

Have you managed to have this script worked?

 

 

---------
Tanya Yatskovskaya
SmartBear Community and Education Manager


TanyaYatskovska
Community Manager

Re: Run a SQL Job from JScript

Hi @scmadden,

 

I've found the following example demonstrating how you can call an SQL stored procedure (even with parameters):

https://smartbear-cc.force.com/portal/KbArticleViewer?name=Call-an-SQL-Stored-Procedure

 

 

---------
Tanya Yatskovskaya
SmartBear Community and Education Manager


View solution in original post

cancel
Showing results for 
Search instead for 
Did you mean: