Solved

TSQL row counts to a Job Output file.

Posted on 2011-03-20
6
331 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
Comment Utility
CAn you post your code?
0
 
LVL 4

Author Comment

by:joevi
Comment Utility
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
Comment Utility
I would need to see the script before I could try and determine what is going on.
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 142

Expert Comment

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

Open in new window

0
 
LVL 4

Author Comment

by:joevi
Comment Utility
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 142

Accepted Solution

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

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

763 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now