Wednesday 19 February 2014

LEN and DATALENGTH Functions in SQL Server

Len() function

Len() function will return number of characters in the string expression excluding only the trailing blanks. Internally it performs RTRIM() operation and give you the count of characters. But it counts the leading blank character.

DataLength() function

DataLength() function will return number of bytes to represent any expression. It returns the storage space required for the characters. It counts the trailing blank space.

No comments:

Post a Comment