DATALENGTH() for for Unicode character set : DATALENGTH « String Functions « SQL Server / T-SQL






DATALENGTH() for for Unicode character set

1>
2> -- DATALENGTH(): .
4>
5>
6> DECLARE @Value1 Int, @Value2 Int
7> SET @Value1 = 2
8> SET @Value2 = 2000000000
9>
10> SELECT DATALENGTH(@Value1), LEN(@Value1), DATALENGTH(@Value2), LEN(@Value2)
11> GO

----------- ----------- ----------- -----------
          4           1           4          10

(1 rows affected)
1>
2>

           
       








Related examples in the same category

1.DATALENGTH(): returns the number of bytes used to manage a value
2.DATALENGTH(@Value)