Get a performance pop within a Sql CLR Stored Procedure

According to the BOL with the October CTP bits, you can get a performance improvement with Sql Server 2005 CLR objects if the send the results directly to the network buffer and bypass managed memory.  How do you do this?

Do this:

SqlCommand sqlCm = SqlContext.GetCommand();
sqlCm.CommandText = "blah, blah, blah.........";
SqlContext.GetPipe().Execute(sqlCm);

instead of

SqlCommand sqlCm = SqlContext.GetCommand();
sqlCm.CommandText = "blah, blah, blah..........";
SqlDataReader sqlDr = sqlCm.ExecuteReader();
SqlContext.GetPipe().Send(sqlCm);

Source: ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/denet9/html/bbdd51b2-a9b4-4916-ba6f-7957ac6c3f33.htm

**Note, no code has been checked against the editor to see if it runs, this is just something I pulled from the BOL.  Your mileage may vary**

1 Comment

Comments have been disabled for this content.