| 发表于:2007-06-29 09:52:277楼 得分:0 |
不是好明白你的意思, 不过可以给你字符串换成表的方法 1 declare @str varchar(200),@sql varchar(200) set @str= 'sdhg,w324,gwre,rweh,we ' select @sql= 'select ' ' '+ replace(@str, ', ', ' ' ' union all select ' ' ') + ' ' ' ' EXEC(@sql) 2 select top 100 id=identity(int,1,1) into # from sysobjects a,sysobjects b declare @str varchar(200) set @str= 'sdhg,w324,gwre,rweh,we ' select substring(@str+ ', ',id,charindex( ', ',@str+ ', ',id)-id) from # where substring( ', '+@str,id,1)= ', ' | | |
|