SQL Server Transact Basic to Expert - Get number of characters using DataLength

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
Ebook Download
View all
Learn
View all