@@ -41,6 +41,9 @@ TRIM ( [ characters FROM ] string )
4141::: moniker-end
4242
4343::: moniker range=">=sql-server-ver16 || >=sql-server-linux-ver16"
44+ > [ !IMPORTANT]
45+ > You will need your database compatibility level set to 160 to use the LEADING, TRAILING, or BOTH keywords.
46+
4447Syntax for [ !INCLUDE [ sssql22-md] ( ../../includes/sssql22-md.md )] and later:
4548
4649``` syntaxsql
@@ -136,6 +139,8 @@ In this example, only the trailing period and spaces from before `#` and after t
136139::: moniker range=">=sql-server-ver16 || >=sql-server-linux-ver16"
137140
138141### C. Remove specified characters from the start of a string
142+ > [ !IMPORTANT]
143+ > You will need your database compatibility level set to 160 to use the LEADING, TRAILING, or BOTH keywords.
139144
140145The following example removes the leading ` . ` from the start of the string before the word ` test ` .
141146
@@ -150,6 +155,8 @@ SELECT TRIM(LEADING '.,! ' FROM ' .# test .') AS Result;
150155```
151156
152157### D. Remove specified characters from the end of a string
158+ > [ !IMPORTANT]
159+ > You will need your database compatibility level set to 160 to use the LEADING, TRAILING, or BOTH keywords.
153160
154161The following example removes the trailing ` . ` from the end of the string after the word ` test ` .
155162
@@ -164,6 +171,8 @@ SELECT TRIM(TRAILING '.,! ' FROM ' .# test .') AS Result;
164171```
165172
166173### E. Remove specified characters from the beginning and end of a string
174+ > [ !IMPORTANT]
175+ > You will need your database compatibility level set to 160 to use the LEADING, TRAILING, or BOTH keywords.
167176
168177The following example removes the characters ` 123 ` from the beginning and end of the string ` 123abc123 ` .
169178
0 commit comments