473,228 Members | 1,662 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,228 software developers and data experts.

nvarchar(max) sql data type equivalen in c#

skg
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
Feb 2 '06 #1
2 12999
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.com> wrote in message
news:Or**************@tk2msftngp13.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

Feb 2 '06 #2
skg
Thanks Marina !!! I posted this in public.SQLServer.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.SqlClient;
using System.Data.SqlTypes;
using Microsoft.SqlServer.Server;
using System.Collections;
using System.Security.Cryptography;
using System.Text;

public partial class UserDefinedFunctions
{

[SqlFunction(IsDeterministic = true, IsPrecise = true, DataAccess =
DataAccessKind.None)]
public static SqlInt32 GetLength(string sInputString)
{
return (SqlInt32)sInputString.Length;
}
};
select top 10
id,datalength(blobfield)[SQLSize],dbo.GetLength(blobfield)[UDFSize] from
Table1 where datalength(blobfield) > 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****************@TK2MSFTNGP09.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.com> wrote in message
news:Or**************@tk2msftngp13.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


Feb 2 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: gordy | last post by:
edit: this came out longer than I thought, any comments about anything here is greatly appreciated. thank you for reading My system stores millions of records, each with fields like firstname,...
6
by: New MSSQL DBA | last post by:
Hi all, we are now planning to upgrade our application from a non-unicode version to a unicode version. The application's backend is a SQL Server 2000 SP3. The concern is, existing business...
4
by: D. | last post by:
Hi, I'm starting a new application in java using JTDS jdbc driver (http://jtds.sourceforge.net) and SQLServer 2005 Express. I have to design the database from scratch and my doubt is if I have to...
3
by: maurox | last post by:
Hi, i have a simple table with a field called "authors". this filed have a nvarchar(max) type (in MSSql 2005). i have a simple query "Select authors FROM table". in query analizer this return...
5
by: haidani | last post by:
Hi, I am new to MS SQL. When I create a column in a table, when shall I use nvarchar or varchar? Please help. Thanks, Mike
2
by: verb13 | last post by:
I am running this query to an sql server 2000 database from my asp code: "select * from MyTable where MySqlServerRemoveStressFunction(MyNtextColumn) = '" & MyAdoRemoveStressFunction(MyString) &...
6
by: =?Utf-8?B?R3JlZw==?= | last post by:
I've come across a few statements that conflict eachother and I'm wondering what is correct. I cam across a web-site (I do not remember the site right now), that explained each data type. For...
1
by: DR | last post by:
When a clr has the input type of SqlString it causes nvarchar(4000) to be the parameter type of the function in sql server. how to modify my CLR function to use nvarchar(max) ?
3
by: amollokhande1 | last post by:
Hi All, I am using Sql server 2005 as a backend for my application. I want to read/write the unicode data using sql query. When I am using insert into UnicodeData values('سي') command and...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.