I have data in an NTEXT type column. I wanted to know the length of the data using a query in sql 2000
----- Updates -----
HI, I used to use datalength. But strange is his return of the wrong values. Is there any other problem I have to check.
Do you want DATALENGTH() ;
DATALENGTH()
SELECT DATALENGTH(ntextcol) FROM T
You can use DATALENGTH .
DATALENGTH
For the datatype ntext type, the ntext size in bytes is two times larger than the entered characters
ntext
This can be confusing.
You can use DATALENGTH to get NTEXT length
NTEXT
Create table TestTable ( Id int identity, NtextCol NTEXT ) GO insert into TestTable Select 'yogesh' GO insert into TestTable Select 'bhadauriya' Select Datalength (NtextCol) - get lenght of the data From testtable Go Drop table TestTable
You can also use LEN ( string_expression ) , where string_expression can be a string expression that needs to be evaluated. string_expression can be a constant, a variable, or a column of either character or binary data.
LEN ( string_expression )
string_expression
ssilas777 mentions "Storage size in bytes, two times the entered characters"
Given this, datalength([nTextColumn]) / 2 as nTextColumn_length should return the specific response specified in the original message.
datalength([nTextColumn]) / 2 as nTextColumn_length
Source: https://habr.com/ru/post/892119/More articles:Ctrl-C does not work when using threading.Timer - pythonhtmltidy problems with script tags - htmltidySimpleHTTPRequestHandler closes the connection before returning from the do_POST method - pythonGoogle v3 MAP API: moving the center between two locations - javascriptAddress space layout for a multi-threaded Linux process - cUnicode strings in .Net with Hebrew letters and numbers - stringText analysis in Arabic / RTL from left to right - stringFor facebook fans only with asp.net c # sdk - c #Graphics.DrawString indicates the opacity of the text - c #establish session for object in rspec integration test - ruby-on-rails-3All Articles