Solved

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

Posted on 2013-06-24
3
349 Views
Last Modified: 2013-06-24
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.
0
Comment
Question by:Nemetona
3 Comments
 
LVL 11

Accepted Solution

by:
David Kroll earned 500 total points
ID: 39271960
Use DataLength().
0
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 39271982
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()
0
 

Author Closing Comment

by:Nemetona
ID: 39272049
thank you, that worked.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question