最佳答案
是否可以在.NET 中捕获 T-SQL 存储过程的打印输出?
我有很多遗留的处理程序,它们使用打印作为 errorMessaging 的手段。例如,是否可以从下面的 PROC 访问输出‘ word’?
-- The PROC
CREATE PROC usp_PrintWord AS
PRINT 'word'
// Some C# Code to would like to pull out 'word'
SqlCommand cmd = new SqlCommand("usp_printWord", TheConnection);
cmd.CommandType = CommandType.StoredProcedure;
// string ProcPrint = ???