I'm running a long-running stored procedure using sqlcmd.exe for automation purposes. However, I observed that in SQL Server 2012, sqlcmd.exe does not produce real-time logging. It displays only when all the SP is completed OR after I stop execution using CTRL+C.
I get real-time output(on screen/log) in sqlcmd.exe of SQL Server 2008.
SQLCMD.EXE -S "RemoteSQL2012Server" -d test -b -E -Q "EXEC dbo.LongRunningSP"
Not Working :
& "E:\SQLServer2012\110\Tools\Binn\SQLCMD.EXE" -S "RemoteSQL2012Server" -d test-b -E -Q "EXEC dbo.LongRunningSP"
By "Not working", I mean that output is not real-time. Is this an issue in SQL 2008 post-versions ? Any workarounds ?
I've verified that the same issue is there in SQL2014 also.
I'm running the commands from powershell.exe. Also, tried from cmd.exe. (Running both as Admin)
Another thing, OSQL.exe does not give this problem.