Hi, folks!
Is there any way to capture the text output of a multiline dynamic TSQL query into a TSQL variable?
NB: "the text output" means all I can see in the messages tab of a query window in SSMS, e.g. the warnings, row counts, results of PRINT statements and so on.
Seems to me I'm looking for a functionality similar to the @query parameter of "sp_send_dbmail", but within a TSQL script/ procedure.
Any ideas?
Regards from Berlin/Germany
SeBaFlu