LEN:-
It shows actual Length of
Declared Variable not as it’s Capacity.
Explanation:-
Char(50),Here
we declare on Char variable with 50 character capacity .
But
we assigned ‘Rahul’ only 5 character.
This
Actual Length is called Len of a Variable.
DATALENGTH:-
But DATALENGTH shows the capacity of a Variable.
Char(50)
here 50 is the capacity of char Variable.
DECLARE @str CHAR(50)
SET @str='Rahul'
SELECT LEN(@str) AS LenCount
SELECT DATALENGTH(@str) AS DataLengthCount
4 comments:
please describe it sir ...............
please describe it sir
Thanks for Comment.
Now i declared with Details.
Thanks for Comment once again.
Thanks for Comment.
Now i declared with Details.
Thanks for Comment once again.
Post a Comment