日期:2014-05-18 浏览次数:20472 次
还用种方法就是动态执行: 例如 go create proc pro_test @a varchar(20) as declare @str varchar(max) set @str='' set @str='select * from test where id in('+@a+')' exec(@str) 这样也行
------解决方案--------------------
cast(substring("2,3,4,5",1,1) as int)取得的是2 (int)
cast(substring("2,3,4,5",3,3) as int)取得的是3
cast(substring("2,3,4,5",5,5) as int)取得的是4
cast(substring("2,3,4,5",7,7) as int)取得的是5