I am trying to call a stored procedure in C# that contains both SELECT statements and PRINT statements. I've managed to get the PRINT statements back by way of a SqlInfoMessageEventHandler, but that doesn't help since there are SELECT statements mixed in that contain information pertaining to the PRINT statements.
The other fun part of this is that the SELECT statements all have varying #s and names of columns.
All I really want to do is capture all of that output into a string variable (kinda like executing the stored procedure in SSMS with the query results being output as text.
Changing the Stored Procedure isn't possible.
Is this possible?