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
Can you please differentiate between a primary key and a unique key?
What are the database roles? : sql server security
What is "scheduled jobs" or "scheduled tasks"?
How to get a list of table columns using the "sp_columns" stored procedure in ms sql server?
How is table type constraint applied to a table?
What is 'Join' and explain its various types.
What are the restrictions applicable while creating views? : SQL Server Architecture
how many bits ip address consist of? : Sql server database administration
How to create a view and a stored procedure in ms sql server using "create view/procedure" statements?
How to insert a new row into a table with "insert into" statements in ms sql server?
How to find a value in another dataset based on current dataset field (ssrs 2008 r2)?
Explain sql delete command?
Does partitioning ssd reduce performance?
What is a database in ms sql server?
How to create a new schema in a database?