I have a strange problem that I need to solve as soon as possible. I have created two CLR UDTs called point and point_list. Each record of a point_list consists of a list of points. I created a CLR stored procedure which reads some raw data and updates the point_list records. When I execute the stored procedure the following error appears :
System.Data.SqlTypes.SqlTypeException: The buffer is insufficient. Read or write operation failed. System.Data.SqlTypes.SqlTypeException: at System.Data.SqlTypes.SqlBytes.Write(Int64 offset, Byte[] buffer, Int32 offsetInBuffer, Int32 count) at System.Data.SqlTypes.StreamOnSqlBytes.Write(Byte[] buffer, Int32 offset, Int32 count) at System.IO.BinaryWriter.Write(Char ch) etc ...
Without seeing your code for the CLR UDT? No idea but something is wrong with it. Maybe you are receicing an 64-bit parameter but only has a 32-bit parameter in your code?
I am new to sql server and I need some more information on how to use varchar(max) instead of my udt. Should I replace my utd with varchar(MAX)? I have defined some methods for my udt like point_list.getDistance, how can I use these with varchar(MAX) ?