Thanks Marina !!! I posted this in public.SQLServe r.programming newsgroup
today, sorry, don't know how to copy the link to that thread for you.
But here is what i am seeing when i do return Length of the input string i
get 4000 always. i am concerned i am loosing bytes when calling the UDF.
Using SQLChar i get correct size. Here is my code snippet. i am i doing
something wrong.
using System;
using System.Data;
using System.Data.Sql Client;
using System.Data.Sql Types;
using Microsoft.SqlSe rver.Server;
using System.Collecti ons;
using System.Security .Cryptography;
using System.Text;
public partial class UserDefinedFunc tions
{
[SqlFunction(IsD eterministic = true, IsPrecise = true, DataAccess =
DataAccessKind. None)]
public static SqlInt32 GetLength(strin g sInputString)
{
return (SqlInt32)sInpu tString.Length;
}
};
select top 10
id,datalength(b lobfield)[SQLSize],dbo.GetLength( blobfield)[UDFSize] from
Table1 where datalength(blob field) > 8000
id SQLSize UDFSize
----------- -------------------- -----------
2 49874 4000
13 28860 4000
62868 8166 4000
62873 9702 4000
62874 36546 4000
"Marina Levit [MVP]" <so*****@nospam .com> wrote in message
news:ex******** ********@TK2MSF TNGP09.phx.gbl. ..
There isn't one. You can have a 'string', but you wouldn't be able to
specify a maximum length to it, and you wouldn't need to specify that it
can hold unicode data.
"skg" <sk*@yahoo.co m> wrote in message
news:Or******** ******@tk2msftn gp13.phx.gbl...i am writing a UDF which takes nvarchar(max) as input parameter. Can any
one
tell me what is the equivalent of this data type in C#.
Thx