I needed to quote an identifier (a column name) with “<“. I checked the documentation for the build-in function QUOTENAME() and I did not find the information that I need. Here is a quick T-SQL to show which characters we can use as a second argument of the function.
1 2 3 4 5 6 7 8 9 10 |
DECLARE @Counter SMALLINT = 1; WHILE (@Counter <= 255) BEGIN IF (QUOTENAME(@Counter, CHAR(@Counter)) IS NOT NULL) BEGIN PRINT CONCAT(@Counter, ' --> >', CHAR(@Counter), '< --> ', QUOTENAME(@Counter, CHAR(@Counter))) END SELECT @Counter += 1; END |
Keep it simple :-)