Is it possible to edit the data returned from command.ExecuteReader, and then return that to SqlContext.Pipe.Send()? Are there any forseeable issues (I have to reset the cursor to the beginning)?
I have a .NET stored procedure that will query a table like this
(code from 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);
}
}
}