Thursday, March 22, 2012
Alert gets executed, but not its job. Am I doing something wrong?
Here is what I did:
1) Checked the Execute Job box
2) Created a job
a) Gave it a name
b) Gave it an owner
c) Left the category as Uncategorized
d) Under the Steps tab added a new step
i) Gave the step a name
ii) Selected Operating System Command (CmdExec) as the type
iii) In the Command box typed the following
cd C:\Blat
blat StandardMessage.txt -to Test.Test@.MyURL.com -s "TEST"
cd C:\
When I copy and paste that EXACT message (cd...blat...cd...) on the command line it works perfectly so it looks like the job isn't getting executed at all.
I also tried to set up an output file (under the Advanted Tab...Operating System Command. That file never gets created either! That makes me REALLY sure the job isn't getting executed.
So, if my Alert gets executed as verified by the history, why isn't my job being kicked off?
THANKS!what account the service is running under? probably system account. you need to have a domain account with minimal rights.|||Originally posted by ms_sql_dba
what account the service is running under? probably system account. you need to have a domain account with minimal rights.
You have lost me here.
My Alert executes just fine. I don't see any way to specify any "account" for the job that gets kicked off to run under.
Where should I look to specify the "account the service is running under"?
Thanks.|||Originally posted by darrinps
You have lost me here.
My Alert executes just fine. I don't see any way to specify any "account" for the job that gets kicked off to run under.
Where should I look to specify the "account the service is running under"?
Thanks.
I THINK what is happening is that the command I want to execute is local to my PC and the exec is attempting ro tun against the local server box.
What I need to do is either install the software there, or better yet (for testing) somehow redirect it to my box.|||try copying all the command line steps in a .bat file and then run that bat file from your scheduler.
Tuesday, March 6, 2012
Aggregate Function task issue
Inside this, we have a OLE DB Data Source which calls and executes a stored procedure.
We use a Row Count Task to count the number of rows returned by the OLE DB Data Dource Task.
Then, we use an aggregate function task to get the sum of all the rows of one particular column that is returned from the OLE DB Data Source.
The issue here is that we want to assign the sum value returned by the Aggregate Function Task to a User Variable named User::Variable. We have tried to assign this by using @.User::Variable and User::Variable, but neither of those return the expected value.
If there is any other method to do the same then let us know.
We have checked the that the row count is greater than zero.
Any help would be very much appreciated.
Thanks in advance.Yep, you can't store that value in a variable.... Your best bet would be to use a script component to capture that result and store it.|||How can we access the output of the aggregate function in script task?
Or Is it possible to use script task after a Data source task (without using aggregate)?
Is there any other method to get the sum of a field of data source task in a variable? I think it can be done using Expressions but when i have treed i was not able to get expression in data flow task.|||Use a script component in transformation mode...
Notice how Jamie uses the row.[fieldname] convention. You'll have an output coming from your aggregate transformation, which you can use in the script component. Search this forum for many examples on working with variables.
http://blogs.conchango.com/jamiethomson/archive/2005/07/04/SSIS-Nugget_3A00_-The-script-component-and-regular-expressions.aspx
Aggregate Function task issue
Inside this, we have a OLE DB Data Source which calls and executes a stored procedure.
We use a Row Count Task to count the number of rows returned by the OLE DB Data Dource Task.
Then, we use an aggregate function task to get the sum of all the rows of one particular column that is returned from the OLE DB Data Source.
The issue here is that we want to assign the sum value returned by the Aggregate Function Task to a User Variable named User::Variable. We have tried to assign this by using @.User::Variable and User::Variable, but neither of those return the expected value.
If there is any other method to do the same then let us know.
We have checked the that the row count is greater than zero.
Any help would be very much appreciated.
Thanks in advance.Yep, you can't store that value in a variable.... Your best bet would be to use a script component to capture that result and store it.|||How can we access the output of the aggregate function in script task?
Or Is it possible to use script task after a Data source task (without using aggregate)?
Is there any other method to get the sum of a field of data source task in a variable? I think it can be done using Expressions but when i have treed i was not able to get expression in data flow task.|||Use a script component in transformation mode...
Notice how Jamie uses the row.[fieldname] convention. You'll have an output coming from your aggregate transformation, which you can use in the script component. Search this forum for many examples on working with variables.
http://blogs.conchango.com/jamiethomson/archive/2005/07/04/SSIS-Nugget_3A00_-The-script-component-and-regular-expressions.aspx
Thursday, February 16, 2012
After RAISERROR executes next line.
I am trying to raise an error in MS SQL Server 2000 using the lines
if x = 1
raiserror('Error Message', 10, 1)
print 'Next Line.'
But, on execution, it shows the error message and goes to the next line.
(prints 'Next Line')
How do I set up the server so that after raising the error, the control goes
to the called program.
Thanks in advance,
PrasanthRAISERROR('blah...',10,1)
RETURN
--
http://www.aspfaq.com/
(Reverse address to reply.)
"Prasanth" <Prasanth@.discussions.microsoft.com> wrote in message
news:895177B6-342D-4F65-8D66-4177C56B8F6E@.microsoft.com...
> Hello,
> I am trying to raise an error in MS SQL Server 2000 using the lines
> if x = 1
> raiserror('Error Message', 10, 1)
> print 'Next Line.'
> But, on execution, it shows the error message and goes to the next line.
> (prints 'Next Line')
> How do I set up the server so that after raising the error, the control
goes
> to the called program.
> Thanks in advance,
> Prasanth|||Hi Prasanth
If I understand you correctly you want to raise an exception so that the
print statement is NOT executed?. Is this correct?
Yours Sincerely
Thomas Kejser
"Prasanth" <Prasanth@.discussions.microsoft.com> wrote in message
news:895177B6-342D-4F65-8D66-4177C56B8F6E@.microsoft.com...
> Hello,
> I am trying to raise an error in MS SQL Server 2000 using the lines
> if x = 1
> raiserror('Error Message', 10, 1)
> print 'Next Line.'
> But, on execution, it shows the error message and goes to the next line.
> (prints 'Next Line')
> How do I set up the server so that after raising the error, the control
> goes
> to the called program.
> Thanks in advance,
> Prasanth|||To put Aaron's suggestion in context:
declare @.x int
set @.x = 1 -- test with @.x = 2 also
if @.x = 1 begin
raiserror('Error Message', 10, 1)
return
end
print 'Next Line.'
Steve Kass
Drew University
Prasanth wrote:
>Hello,
>I am trying to raise an error in MS SQL Server 2000 using the lines
> if x = 1
> raiserror('Error Message', 10, 1)
> print 'Next Line.'
>But, on execution, it shows the error message and goes to the next line.
>(prints 'Next Line')
>How do I set up the server so that after raising the error, the control goes
>to the called program.
>Thanks in advance,
>Prasanth
>
After RAISERROR executes next line.
I am trying to raise an error in MS SQL Server 2000 using the lines
if x = 1
raiserror('Error Message', 10, 1)
print 'Next Line.'
But, on execution, it shows the error message and goes to the next line.
(prints 'Next Line')
How do I set up the server so that after raising the error, the control goes
to the called program.
Thanks in advance,
PrasanthRAISERROR('blah...',10,1)
RETURN
http://www.aspfaq.com/
(Reverse address to reply.)
"Prasanth" <Prasanth@.discussions.microsoft.com> wrote in message
news:895177B6-342D-4F65-8D66-4177C56B8F6E@.microsoft.com...
> Hello,
> I am trying to raise an error in MS SQL Server 2000 using the lines
> if x = 1
> raiserror('Error Message', 10, 1)
> print 'Next Line.'
> But, on execution, it shows the error message and goes to the next line.
> (prints 'Next Line')
> How do I set up the server so that after raising the error, the control
goes
> to the called program.
> Thanks in advance,
> Prasanth|||Hi Prasanth
If I understand you correctly you want to raise an exception so that the
print statement is NOT executed?. Is this correct?
Yours Sincerely
Thomas Kejser
"Prasanth" <Prasanth@.discussions.microsoft.com> wrote in message
news:895177B6-342D-4F65-8D66-4177C56B8F6E@.microsoft.com...
> Hello,
> I am trying to raise an error in MS SQL Server 2000 using the lines
> if x = 1
> raiserror('Error Message', 10, 1)
> print 'Next Line.'
> But, on execution, it shows the error message and goes to the next line.
> (prints 'Next Line')
> How do I set up the server so that after raising the error, the control
> goes
> to the called program.
> Thanks in advance,
> Prasanth|||To put Aaron's suggestion in context:
declare @.x int
set @.x = 1 -- test with @.x = 2 also
if @.x = 1 begin
raiserror('Error Message', 10, 1)
return
end
print 'Next Line.'
Steve Kass
Drew University
Prasanth wrote:
>Hello,
>I am trying to raise an error in MS SQL Server 2000 using the lines
> if x = 1
> raiserror('Error Message', 10, 1)
> print 'Next Line.'
>But, on execution, it shows the error message and goes to the next line.
>(prints 'Next Line')
>How do I set up the server so that after raising the error, the control goe
s
>to the called program.
>Thanks in advance,
>Prasanth
>
After RAISERROR executes next line.
I am trying to raise an error in MS SQL Server 2000 using the lines
if x = 1
raiserror('Error Message', 10, 1)
print 'Next Line.'
But, on execution, it shows the error message and goes to the next line.
(prints 'Next Line')
How do I set up the server so that after raising the error, the control goes
to the called program.
Thanks in advance,
Prasanth
RAISERROR('blah...',10,1)
RETURN
http://www.aspfaq.com/
(Reverse address to reply.)
"Prasanth" <Prasanth@.discussions.microsoft.com> wrote in message
news:895177B6-342D-4F65-8D66-4177C56B8F6E@.microsoft.com...
> Hello,
> I am trying to raise an error in MS SQL Server 2000 using the lines
> if x = 1
> raiserror('Error Message', 10, 1)
> print 'Next Line.'
> But, on execution, it shows the error message and goes to the next line.
> (prints 'Next Line')
> How do I set up the server so that after raising the error, the control
goes
> to the called program.
> Thanks in advance,
> Prasanth
|||Hi Prasanth
If I understand you correctly you want to raise an exception so that the
print statement is NOT executed?. Is this correct?
Yours Sincerely
Thomas Kejser
"Prasanth" <Prasanth@.discussions.microsoft.com> wrote in message
news:895177B6-342D-4F65-8D66-4177C56B8F6E@.microsoft.com...
> Hello,
> I am trying to raise an error in MS SQL Server 2000 using the lines
> if x = 1
> raiserror('Error Message', 10, 1)
> print 'Next Line.'
> But, on execution, it shows the error message and goes to the next line.
> (prints 'Next Line')
> How do I set up the server so that after raising the error, the control
> goes
> to the called program.
> Thanks in advance,
> Prasanth
|||To put Aaron's suggestion in context:
declare @.x int
set @.x = 1 -- test with @.x = 2 also
if @.x = 1 begin
raiserror('Error Message', 10, 1)
return
end
print 'Next Line.'
Steve Kass
Drew University
Prasanth wrote:
>Hello,
>I am trying to raise an error in MS SQL Server 2000 using the lines
>if x = 1
>raiserror('Error Message', 10, 1)
>print 'Next Line.'
>But, on execution, it shows the error message and goes to the next line.
>(prints 'Next Line')
>How do I set up the server so that after raising the error, the control goes
>to the called program.
>Thanks in advance,
>Prasanth
>