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 ««12

pass variables between SQL Server tasks in a JOB Expand / Collapse
Author
Message
Posted Monday, January 28, 2013 4:20 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 10:11 AM
Points: 36,995, Visits: 31,516
Thanks for the feedback. But, remember, this was supposed to be done in a job with multiple steps without the use of SSIS. The global variables there do no apply to this particular request because SSIS is not allowed.

--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1412693
Posted Thursday, January 31, 2013 6:27 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, August 13, 2014 4:35 AM
Points: 1, Visits: 108
Hi, I would also need to pass a string from one JobAgent Step to the next (WITHOUT SSIS). In addition, my first step is a PowerShell Command which fetches the string basically. So I also need to know if it's possible to pass a value from a PS-Step to a T-SQL-Step?

Many Thanks in advance!
FS
Post #1414077
Posted Thursday, January 31, 2013 6:40 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Yesterday @ 11:39 PM
Points: 1,669, Visits: 2,212
I'm not aware of any solution other than that originally offered for this chain of posts.... In your case, use PowerShell to run a VBScript with ADO code and insert the string into a single-record table and then use that table as the string source for your T-SQL script.


Steve
(aka sgmunson)

Internet ATM Machine
Post #1414089
Posted Tuesday, April 2, 2013 5:55 PM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Yesterday @ 3:33 PM
Points: 373, Visits: 600
It would be nice to be able to pass parameters between steps. I'm doing something similar. I would have liked to do the related T-SQL in a separate step. However, I execute the T-SQL in same PSH step.

invoke-sqlcmd -Query $query `
-serverinstance $serverinstance -database 'master' -QueryTimeout 600


Randy
"Perhaps I'm not the only one that does not know what you are doing."
Post #1438137
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse