------解决方案-------------------- --传递字符串 分割字符串 分别显示 ALTER function [dbo].[f_splitstr] ( @SourceSql varchar(8000), @strSeprate varchar(100) ) returns @temp table (F1 varchar(100)) as begin declare @ch as varchar(100) set @SourceSql=@SourceSql+@StrSeprate while(@SourceSql<>'') begin set @ch=left(@SourceSql,Charindex(',',@SourceSql,1)-1) insert @temp values(@ch) set @SourceSql=stuff(@SourceSql,1,charindex(',',@SourceSql,1),'') end return end 给你个例子可以看看