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 to convert numeric expression data types using the cast() function?

772


What are commonly used odbc functions in php?

774


What is the minimum and maximum number of partitions required for a measure group? : sql server analysis services, ssas

847


Explain filtered indexes?

786


what is denormalization and when would you go for it? : Sql server database administration

936


What is 3nf normalization form?

811


What is a transaction and why is it important?

796


What are diverse clauses that form a part of sql?

844


Can you explain powershell included in sql server 2008?

719


explain what is a schema in sql server 2005? Explain how to create a new schema in a database? : Sql server database administration

743


What is filtered index?

862


What are the different types of locks in the database?

692


what is the main function of a query parameter?

128


How to connect Azure federated root database and apply federation in entity framework?

103


how many bits ip address consist of? : Sql server database administration

688