When running a query on SQL Server and using Results to file function, SQL Server automatically adds a success message at the end of the file that looks like this:
(2620182 row(s) affected)
With a small file, you could pop it open a text editor and remove it manually, but when your file is millions of records, it takes a bit more work. I could use grep or sed to remove it, but that’s a manual process.
Is there a way I can surpress that message from showing up in my saved result set?
Add
SET NOCOUNT ON;before executing your query.