'' ' ''
1 USE AdventureWorks2008R2; 2 GO 3 --CAST 4 5 SELECT 'CAST' "CAST", 6 CAST('1990-11-1' AS VARCHAR(10)) 转为字符串, 7 CAST('1990-11-1' AS DATETIME) 转为日期 8 9 --CONVERT 10 SELECT 'CONVERT' "CONVERT", 11 CONVERT(VARCHAR(10),'2999') 转为字符串, 12 CONVERT(INT,'2999') 转为整数 13 14 --'' 15 16 select 'sb' 17 select '''SB''' 18 SELECT '"SB"' --列名 19 SELECT 'it''s a pen'