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 varcharvarbinarytextimagenvarchar, 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

0 comments:

Post a Comment

 

Popular Posts

developer-express Copyright © 2009 Black Nero Blogspot Templatesis Designed by Ipietoon Sponsored by Online Business Journal