This blog shows how to use the DataLength function to get the number of Unicode characters of a string using SQL.
Example:
SELECT DATALENGTH(N'This is a sample lenght to check')
The expected output would be 68
SQL Server Transact Basic to Expert - Get number of characters using DataLength
SQL Server Transact Basic to Expert - Get number of characters using DataLength


Join the conversation! Your thoughts help the community grow.