Solved

TSQL row counts to a Job Output file.

Posted on 2011-03-20
6
336 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
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

Business Impact of IT Communications

What are the business impacts of how well businesses communicate during an IT incident? Targeting, speed, and transparency all matter. Find out more in this infographic.

Question has a verified solution.

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

This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
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
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

752 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