Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

find length of the ntext column type data in sql 2000

Tags:

sql

sql-server

I have a data in column which is of type NTEXT. I wanted to know the length of the data using query in sql 2000

-----Updates -----

HI, I had used the datalength thing earlier. But strangely its returning wrong values. Is there any other issue thts specific tht i shlould check.

like image 996
Hacker Avatar asked Jul 06 '11 10:07

Hacker


3 Answers

You want DATALENGTH();

SELECT DATALENGTH(ntextcol) FROM T
like image 102
Alex K. Avatar answered Sep 28 '22 09:09

Alex K.


You can use DATALENGTH itself.

For datatype ntext storage size in bytes, is two times the number of characters entered

This might have caused you confusion.

like image 24
ssilas777 Avatar answered Sep 28 '22 09:09

ssilas777


You can use DATALENGTH to get the length of a NTEXT

like image 35
Balanivash Avatar answered Sep 28 '22 08:09

Balanivash