How to get the length of the image, text, ntext data type

Hi

Many a times we want to find the amount of space a particular database column is talking. We have the Len function in the SQL to get the length of a particular column data.

But the problem with this unction is that it does not work on the ntext, text or the image data type.

So when you have to find the length of a text, ntext or image data type use DATALENGTH function. This function can be used on all data types.

This is another of those functions that is not used daily but can be very helpful at difficult times.

Hope this helps
Thanks
Vikram


Share this post   Email it |  digg it! |  reddit! |  bookmark it!

Feedback

Please post your comments:

Name:  
Email (optional): Your email address will not be posted.
URL (optional):
Comments: HTML will be ignored, URLs will be converted to hyperlinks  
Enter the text you see in the box:
 
Copyright © 2006 - 2009 Vikram Lakhotia