标签:
ALTER procedure [dbo].[proName] @Ids varchar(1000), @submitDate date as begin declare @i int set @Ids=rtrim(ltrim(@Ids)) set @i=CHARINDEX(‘;‘,@Ids) while @i>=1 begin insert into tbName(guidName1,guidName2,SubmitDate) values(NEWID(),convert(uniqueidentifier,left(@Ids,@i-1)),convert(datetime,@submitDate)) set @Ids=substring(@Ids,@i+1,len(@Ids)-@i) set @i=CHARINDEX(‘;‘,@Ids) end end
标签:
原文地址:http://www.cnblogs.com/silence-blog/p/5610135.html