views:

384

answers:

2

Is there a way to suppress "x rows affected" in SQLCMD from the command line?

I'm running an MSBuild script and don't want it clogging up my log on my build server.

I'd rather not have to add "SET NOCOUNT ON" in every script, so if there's a way to do it from the command line, that would be fantastic.

+2  A: 

What about creating a startup script with SET NOCOUNT ON in the script (assign the script to the SQLCMDINI environment variable). http://msdn.microsoft.com/en-us/library/ms162773.aspx

fupsduck
I think the SQLCMDINI option should work.
Cade Roux
Cade is right -i and -q are mutually excusive - I'll update.
fupsduck
+2  A: 

The -i and -q options are mutually exclusive.

However, you might be able to do -i setnocount.sql,otherscript.sql using the multiple files feature and effectively an "included" common first file.

Cade Roux