Wednesday, 27 October 2010
SQL: Get the length of text, ntext & image
Ever needed to find the lengh of a ntext field in SQL only to be met with the following error message, whilst using the LEN() function?
This can be achieved by simply using the DATALENGHT() function. DATALENGTH is especially useful with varchar, varbinary, text, image, nvarchar, and ntext data types because these data types can store variable-length data.
Note: Compatibility levels can affect return values. For more information about compatibility levels
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment