Article ID: 294412 - View products that this article applies to.
This article was previously published under Q294412
BUG #: 353170 (SHILOH_BUGS)
When you create a T-SQL job step that contains SET NOCOUNT ON, and you send the results to an output file, that file may still contain the rowcount line.
Change the job step type to Operating System Command (CmdExec) and Osql.exe. If it's a single query, pass the query using the -Q parameter and specify the output file using the -o parameter.
If the job step contains multiple queries, save them in a script file, pass the script file to Osql.exe using the -i parameter, and specify the output file using the -o parameter. For more information, see SQL Server Books Online.
To reproduce this problem, use SQL Enterprise Manager to create a job that contains the following T-SQL script as a job step:
On the Advanced tab for that job step, specify that the output should go to an output file. Then, after running the job, open that output file in any text editor and you will see the following line at the bottom:
For additional information about setting up and running jobs, see the "Implementing Jobs" topic in Books Online.
(21 rows(s) affected)
Contact us for more help
Connect with Answer Desk for expert help.