How to suppress an error message in the output file using SQLCMD
Posted on 2007-03-29
How can I get SQLCMD to suppress an error message in the output file? Specifically, when running the following script :
sqlcmd -S pdc-elite -E -h-1 -w 180 -r1 -m-0 -d son_db -I -i
I get the following at the beginning of my output file:
Msg 3701, Level 11, State 5, Server PDC-ELITE, Line 5
Cannot drop the table '#ckdetail', because it does not exist or you do not have permission.
I don't want to have this message returned in the output file. I know my syntax isn't correct yet as I've been playing with different settings and haven't found one that works yet....still learning sqlcmd. I'm getting the results I need, I just need it to omit that message as I have to use SED to modify this after the fact as is and I don't want to muddy the water even more with this message :-)