Find the Length of a Text Field in SQL

28 Sep 2010

SQL


Normally you can use the LEN function to find the length of a string field, however this does not work on a text field. Instead, you need to use the DATALENGTH function:

SELECT MAX(DATALENGTH(tbTable.TextField))


 

Copyright © 2024 carlbelle.com