The DATALENGTH() function returns the number of bytes used to manage a value. : DATALENGTH « System Functions « SQL Server / T-SQL Tutorial

Home
SQL Server / T-SQL Tutorial
1.Query
2.Insert Delete Update
3.Table
4.Table Join
5.Data Types
6.Set Operations
7.Constraints
8.Subquery
9.Aggregate Functions
10.Date Functions
11.Math Functions
12.String Functions
13.Data Convert Functions
14.Analytical Functions
15.Sequence Indentity
16.View
17.Index
18.Cursor
19.Database
20.Transact SQL
21.Procedure Function
22.Trigger
23.Transaction
24.XML
25.System Functions
26.System Settings
27.System Tables Views
28.User Role
29.CLR
SQL Server / T-SQL Tutorial » System Functions » DATALENGTH 
25.7.2.The DATALENGTH() function returns the number of bytes used to manage a value.
3>
4> DECLARE @Value VarChar(20)
5> SET @Value = 'abc'
6SELECT DATALENGTH(@Value)
7SELECT LEN(@Value)
8> GO

-----------
          3

(rows affected)

-----------
          3

(rows affected)
25.7.DATALENGTH
25.7.1.Using DATALENGTH to determine length of a string value.
25.7.2.The DATALENGTH() function returns the number of bytes used to manage a value.
25.7.3.SELECT DATALENGTH(@Value2)
25.7.4.DATALENGTH Versus COL_LENGTH to determine length of a string value.
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.