Avatar of tmaususer
tmaususer
Flag for United States of America asked on

sql server agent jobs schedule question

Hello experts. I have a sql script the runs a stored procedure. The stored procedure clears and updates some rows in some tables. So when I run the sql script in visual studio, it shows me the results of what rows were updated. Example:
0 rows affected
0 rows affected
84 rows affected

I want to run this job as a scheduled job and I think I have it setup correctly. Except here is my question. When the scheduled job kicks off all I get is an email that the job was successful but I do not see what rows were affected like I do in visual studio. Is it possible to see what rows were affected via a schedule job and if so how?
Microsoft SQL Server 2008Microsoft SQL Server

Avatar of undefined
Last Comment
tmaususer

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Kyle Abrahams

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Scott Pletcher

If that's something you need to know, I'd log it into a table then include a SELECT in the email to pull the relevant data for that email.  You could set up a process to automatically delete obsolete data from the table.
tmaususer

ASKER
Thank you so much!
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck