Link to home
Start Free TrialLog in
Avatar of Nemetona
Nemetona

asked on

how can I find out how many characters are in an ntext field?

Hello,  I have a field in a table which is of type ntext.  

I need to check how many characters are in this field to make sure that the import has pulled in all the data I expected it to.

When I try to create a query looking for the length of the field I get an error message.  Could someone please give me the correct syntax.

In MS Access I would have said:

SELECT  Len([qText]) AS Expr1
FROM STuestions

Could you give me the equivalent for sql server 2012.
ASKER CERTIFIED SOLUTION
Avatar of David Kroll
David Kroll
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Aneesh
if you are using sql server 2012, change the datatype to nvarchar(max) ; ntext and text are deprecated from 2008 onwards. on varchar(max) you can use LEN()
Avatar of Nemetona
Nemetona

ASKER

thank you, that worked.