Sample Header Ad - 728x90

If RAISERROR is as good as deprecated, how are you supposed to flush the PRINT buffer?

-1 votes
1 answer
424 views
RAISERROR is as good as deprecated. [The documentation](https://learn.microsoft.com/en-us/sql/t-sql/language-elements/raiserror-transact-sql?view=sql-server-ver16) says > New applications should use THROW instead of RAISERROR. Yet, it is commonly used to [flush the PRINT buffer](https://stackoverflow.com/questions/306945/how-do-i-flush-the-print-buffer-in-tsql) . Suppose that I'm writing a long stored procedure and I want regular reports of what step it is on. If RAISERROR is out of the question, how should I PRINT from it? Assume a relatively recent version of SQL Server. Let's say 2019.
Asked by J. Mini (1235 rep)
Nov 30, 2023, 06:32 PM
Last activity: Nov 30, 2023, 11:02 PM