是否可以编辑从 command.ExecuteReader 返回的数据,然后将其返回给 SqlContext.Pipe.Send()?是否有任何可预见的问题(我必须将光标重置到开头)?
我有一个 .NET 存储过程,它将查询这样的表
(来自 MSDN 的代码)
public class StoredProcedures
{
/// <summary>
/// Execute a command and send the resulting reader to the client
/// </summary>
[Microsoft.SqlServer.Server.SqlProcedure]
public static void SendReaderToClient()
{
using(SqlConnection connection = new SqlConnection("context connection=true"))
{
connection.Open();
SqlCommand command = new SqlCommand("select FirstName,LastName, PictureURL from myTable", connection);
SqlDataReader r = command.ExecuteReader();
//QUESTION: Can I modify "r" here, and return it below?
SqlContext.Pipe.Send(r);
}
}
}