I have a problem, that I can't solve. I'm using SQL Server 2005, C# CLR for using outer dll. The problem is at length of parameter. I need to use as function parameter type varchar(max). If at C# code I use string, SqlSring, I can't use T-SQL type varchar(max), just varchar(4000) of nvarchar(4000). I need to say, that can be situations, when I need to use more then 4000 symbols, so I need know, what C# type I need to use for varchar(max).
I have read a lot of articles, and several of them say, that for this I can use SqlChars. But! I have manipulations with strings. How can I have actions with string or SqlString and then convert to SqlChars? (It is possible SqlChars.ToString() or SqlChars.ToSqlString()).
I didn't find any C# code for this.
varchar(max)string that's using its maximum capacity will not be loadable into a CLR string, since it will exhaust the address space. Can you be more explicit about what actions you want to perform against these strings?varchar(max)as well as a .NETstringinstance could be up to 2 GB in size....varchar(max)variable can contain more than 2GB. But I was mostly working from the other side. Certainly under 32 bit CLR, you can't actually allocate a 2GB object, and I think you can struggle even under 64 bit.