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

What is a periodical index?

679


what is difference between view and Dip.

2213


What is the difference between having clause and where clause in sql server?

812


What is cursor in ms sql server?

803


Please illustrate physical database architecture? : SQL Server Architecture

769


Explain throw statement in sql server 2008?

771


What is a schema in ms sql server 2005?

757


What is acid mean in sql server?

770


How can I change procedure name in sql server?

738


What is the language structure to add a record to a table?

791


Which are ddl commands?

734


What is 2nf normalization?

755


define and explain the differences between clustered and non-clustered indexes.

865


Do you know what is recursion? Is it possible for a stored procedure to call itself or recursive stored procedure? How many levels of sp nesting is possible?

811


What are the disadvantages of primary key and foreign key in SQL?

848