What are the difference between data length and length in
SQL Server-2008?

Answer Posted / bindu

The DATALENGTH function counts both trailing spaces and preceeding spaces when calculating the length of the expression.
The DATALENGTH function will return NULL, if the expression is NULL.

The LEN function does NOT count trailing spaces at the end of the string when calculating the length of the string.
The LEN function does count spaces at the start of the string when calculating the length of the string.
The LEN function will return NULL, if the string is NULL.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I create an extended event in sql server?

670


Explain full-text indexing?

693


How can I create a report based on a query? : sql server management studio

759


what is a schema in sql server 2005? : Sql server database administration

692


plss anybody specify tha constrian management system in dbms

1802






Explain the functionalities that views support?

856


What are cursors stored procedures and triggers?

684


what's new in sql server 2016?

728


What is the difference between char, varchar and nvarchar?

756


What is sparse columns of sql server 2008?

791


How to maintain a fill factor in existing indexes?

704


What is built-in function?

704


Can you edit the .rdl code associated with a linked report?

121


What are sql server procedures?

733


What is meant by indexing?

665