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 delete query?

519


What are the kinds of subquery?

526


what is normalization? Explain different levels of normalization? : Sql server database administration

650


What are the advantages of partitioning?

638


How can you find out if the current user is a member of the specified microsoft® windows nt® group or microsoft sql server™ role?

594






Tell me what are the advantages of using stored procedures?

566


Data table as parameter in sql server?

560


How you can add messages to the nt event log from within a stored procedure?

563


How to delete exactly duplicate records from a table?

603


What is the security model used in sql server 2005?

508


What are dml (data manipulation language) statements in ms sql server?

547


can any body tell me how to know the password of current user in sql server

1573


Can you explain powershell included in sql server 2008?

503


What is index in an assignment?

527


What is the difference between a "where" clause and a "having" clause?

611