DECLARE @NUMBER INT
DECLARE @QUOTE CHAR(1)
SET @QUOTE = '"'
SET @TEXT = 'hello'
SET @NUMBER = 13
--bracketed with default brackets
SELECT QUOTENAME(@TEXT), len(@TEXT), len(quotename(@TEXT))
--bracketed with default brackets
--note that an implicit conversion occurs)
SELECT QUOTENAME(@NUMBER)
--bracketed with a double quote
SELECT QUOTENAME(@TEXT, @QUOTE)
No comments:
Post a Comment