Table of Contents
LEN Function in SQL Server is easier to understand when the core ideas are paired with practical examples. The sections below explain the topic clearly, highlight useful steps, and point out details that can prevent common errors.
The article will explore and show you how to use the LEN function in SQL Server to return the number of characters of an input string but does not include spaces at the end.
Describe
The LEN function in SQL Server returns the length of the specified string. It is important that the LEN function does not include whitespace characters at the end of the string when calculating length.
Syntax
To use the LEN function in SQL Server, we use the following syntax:
LEN(chuoi)
SELECT LEN('TipsMake.com');Result: 15SELECT LEN('TipsMake.com ');Result: 15 (Dấu cách ở cuối chuỗi không được tính vào độ dài)SELECT LEN(' TipsMake.com');Result: 24SELECT LEN(' TipsMake.com ');Result: 24SELECT LEN(' ');Result: 0SELECT LEN(NULL);Result: NULL
FAQ
What should you know about describe?
The LEN function in SQL Server returns the length of the specified string. It is important that the LEN function does not include whitespace characters at the end of the string when calculating length.
What should you know about syntax?
To use the LEN function in SQL Server, we use the following syntax:
What is LEN Function in SQL Server?
The article will explore and show you how to use the LEN function in SQL Server to return the number of characters of an input string but does not include spaces at the end.
Reader Comments 0
Sign in with email or Google to join the discussion.