Let say I have a stored procedure like this:
begin try drop procedure test_print end try begin catch end catch;
go
create procedure test_print
as
begin
print 'Hello'
print 'World';
end
go
exec test_print
How can I capture the print messages in the stored procedure test_print and save it into a variable?
Thanks.