1.Split SQL Server 2008 新语法: DECLARE @str VARCHAR(MAX) SET @str = REPLACE(@teeIDs, ',', '''),(''') SET @str = 'SELECT * FROM (VALUES(''' + @str + ''')) AS V(A)' EXEC (@str) 据说这个SQL语法是SQL Server 2008的. SELECT * FROM (VALUES(1),(2),(3)) AS V(A) 配合个临
sql server 获取月份天数:1,SELECT 32-DAY(CAST('2015-03-01' as datetime)+32-DAY(CAST('2015-03-01' as datetime))) 2,SELECT 32-DAY(getdate()+32-DAY(getdate())) 3,select convert(char(10),dateadd(d,-1,dateadd(m,1,CAST('2015-02-01' as datetime))),120):2015-02-28