Linux SQL Transact-SQL Windows

Using Transact SQL to get length of TEXT field [T-SQL]

To calculate the lenght of a TEXT field the LEN function used to calculate the length of VARCHAR fields won’t work.

You need to use the DATALENGTH T-SQL function:

SELECT DATALENGTH(myTextField) AS lengthOfMyTextField

Leave a Reply

Your email address will not be published. Required fields are marked *