This worked for me by simply placing the GO command after the print commands, for example
print 'test' print 'test' go
In general, my conclusion is the following: the output of the mssql script of execution executed in the SMS-graphic interface or with sqlcmd.exe is cleared in the file, stdoutput, gui-window in the first GO statement or until the end of the script.
Flushing inside a stored procedure works differently since you cannot place GO inside.
Link: tsql go instruction
Robert Lujo May 23 '15 at 17:19 2015-05-23 17:19
source share