From: kj on 14 Feb 2010 22:41 Thanks for your reply. I guess i am not using VS auto deploy. I deploy my assembly using create/alter assembly. My function looks like this SqlChars^ func1(SqlBytes Data, SqlString a, SqlString b) { SqlChars ^output = gcnew SqlChars(); .. .. .. while ((bytesRead = Data.Read(offsetr,tmpInBuffer, 0, chunkSize)) > 0) { read and process on Data output->write(....) // write processed data in output. } return output; } Input data can be upto max limit of VARBINARY(MAX) If I write data to memorystream as MemoryStream ^ms = gcnew MemoryStream(); ms->Write(tmpOutBuffer,0,tmpOutBytes); and then return SqlChars Encoding ^u8 = Encoding::UTF8; output = gcnew SqlChars(u8->GetString(ms->ToArray())); return output; it works fine till 30MB and then result in ..NET Framework execution was aborted by escalation policy because of out of memory. Bob Beauchemin wrote: Are you using DDL or VS autodeploy to deploy your CLR function? 14-Feb-10 Are you using DDL or VS autodeploy to deploy your CLR function? If you are using VS autodeploy, have you decorated your return value with the SqlFacet attribute and specified MaxSize = -1? Otherwise you will get generated DDL for nvarchar(4000). Hope this helps, Bob Beauchemin SQLskills Previous Posts In This Thread: Submitted via EggHeadCafe - Software Developer Portal of Choice Build a Selected Text Favorites Utility for your Web Site http://www.eggheadcafe.com/tutorials/aspnet/d72a2557-4ffd-4d29-bf1c-86feb39cae83/build-a-selected-text-fav.aspx
|
Pages: 1 Prev: Using SqlBytes/SqlChar write method in CLR Next: Using SqlBytes/SqlChar write method in CLR |