Solved

TSQL row counts to a Job Output file.

Posted on 2011-03-20
6
335 Views
Last Modified: 2012-08-14
How do I get TSQL script output to the job output file? I'm currently getting job messages but no rowcounts, etc.
0
Comment
Question by:joevi
  • 2
  • 2
  • 2
6 Comments
 
LVL 6

Expert Comment

by:AkAlan
ID: 35175820
CAn you post your code?
0
 
LVL 4

Author Comment

by:joevi
ID: 35175902
This is just a test script:
Update runs set PostRunBPM = PostRunBPM
...and we get row counts when firing from SSMS.

It's in a job thats of TSQL type, that has an output file on a local server folder (using drive letter not UNC).

In one iteration I even set nocount off in the script but still get only the following in the output file.
Job 'Test' : Step 1, 'Test' : Began Executing 2011-03-20 09:14:36
0
 
LVL 6

Expert Comment

by:AkAlan
ID: 35175921
I would need to see the script before I could try and determine what is going on.
0
Free Webinar: AWS Backup & DR

Join our upcoming webinar with experts from AWS, CloudBerry Lab, and the Town of Edgartown IT to discuss best practices for simplifying online backup management and cutting costs.

 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 35175939
what about:
Update runs set PostRunBPM = PostRunBPM
select @@rowcount 'rows updated'

Open in new window

0
 
LVL 4

Author Comment

by:joevi
ID: 35176027
angelll: I should have mentioned this is part of a busy production environment where we're getting lot's of ad-hoc, long running scripts that I wanted to start parking in jobs (less workstation baby sitting) but I need the row counts (even if the job doesn't fail).

I didn't want to have to insert 'select @@rowcount' in the scripts and was hoping I was missing something in the job step configuration.

Is 'Select @@rowcount' my only option?

Thanks
0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 35176098
from what I know: yes.
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
I have a large data set and a SSIS package. How can I load this file in multi threading?
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question