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