If you use SQL scripts with Microsoft SQL Server, you may want to clean up the output to make your script log messages more readable. Here are some recommendations to beautify the output:
SET NOCOUNT ON -- suppress output of "rows affected" messages
@@ROWCOUNT -- get rows affected by previous statement
PRINT -- send a useful message to script output (can include @@ROWCOUNT, etc)
If you want to track script execution time, try printing a date/time string at key places during your script execution. There are many ways to run SQL scripts. From the command line you can use the popular “sqlcmd” utility. If you prefer the GUI, you can run your script within SQL Server Management Studio (SSMS).
If you’re printing a string including the row count, try something like this:
PRINT 'Congratulations, you got '+CAST(@@ROWCOUNT AS VARCHAR)+' records';