Difference between Length() and DataLength() using SqlServer?

Len( ):-
Length function return the number of Characters of the specified string expression,excluding blank spaces.

select Len('inthiyaaz ') as length

OutPut:-
length
9

DataLenght( ):-
DataLength function return the number of Characters of the specified string expression,including blank spaces.

select datalength ('inthiyaaz ') as Datalength

OutPut:-
Datalength
11

Ebook Download
View all
Learn
View all