Showing posts with label tsql. Show all posts
Showing posts with label tsql. Show all posts

Monday, March 26, 2012

Passing Information between SQL Agent Job Steps

Is it possible to passing information between SQL Agent Job Steps?
Such as the following job that has 2 tsql steps.
Step 1) Trans sql select * from myTable
Step 2) send result from Step 1 using CDO.
For the example you listed, one option is on the first step you can
have the results of this output to a file. You do this by selecting
the step, go to the advanced tab and then put in the path and file
name for the Output file.
Then on Step 2, you can send the file from step 1.
-Sue
On Mon, 11 Oct 2004 17:51:02 +0100, "Robin" <robin9876@.hotmail.com>
wrote:

>Is it possible to passing information between SQL Agent Job Steps?
>Such as the following job that has 2 tsql steps.
>Step 1) Trans sql select * from myTable
>Step 2) send result from Step 1 using CDO.
>
sql

Passing Information between SQL Agent Job Steps

Is it possible to passing information between SQL Agent Job Steps?
Such as the following job that has 2 tsql steps.
Step 1) Trans sql select * from myTable
Step 2) send result from Step 1 using CDO.
Perhaps you could use a global temp table (##).
Keith
"Robin" <robin9876@.hotmail.com> wrote in message
news:uWFWrJ7rEHA.1988@.TK2MSFTNGP09.phx.gbl...
> Is it possible to passing information between SQL Agent Job Steps?
> Such as the following job that has 2 tsql steps.
> Step 1) Trans sql select * from myTable
> Step 2) send result from Step 1 using CDO.
>
|||Besides Keith's answer, you have anther possibility. You can use DTS, store
results of a T-SQL task in a global variable and send mail using Sed Mail
task or ActiveX script with CDO.
Dejan Sarka, SQL Server MVP
Associate Mentor
Solid Quality Learning
More than just Training
www.SolidQualityLearning.com
"Robin" <robin9876@.hotmail.com> wrote in message
news:uWFWrJ7rEHA.1988@.TK2MSFTNGP09.phx.gbl...
> Is it possible to passing information between SQL Agent Job Steps?
> Such as the following job that has 2 tsql steps.
> Step 1) Trans sql select * from myTable
> Step 2) send result from Step 1 using CDO.
>

Monday, March 12, 2012

passing a query into a variable

What is the easiest way to pass a value into a variable...
TSQL...
declare @.@.test int
--select count(*) from authors
select count(*) into @.@.test from authorsstupid question... resolved it... guys...
my apologies....