This article has been archived. It is offered "as is" and will no longer be updated.
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.
Microsoft has confirmed this to be a problem in SQL Server 2000.
To reproduce this problem, use SQL Enterprise Manager to create a job that contains the following T-SQL script as a job step:
set nocount onselect * from pubs.dbo.sales
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:
(21 rows(s) affected)
For additional information about setting up and running jobs, see the "Implementing Jobs" topic in Books Online.