日期:2014-05-18 浏览次数:20513 次
CREATE PROCEDURE MakePlayList1(@File1 varchar(50),@sdate varchar(10),@edate varchar(10),@sTime varchar(8),@eTime varchar(8)) AS begin --删除旧记录 delete from playlist where [filename]=@File1 insert into Playlist([filename],playdate,sTime,eTime) select @File1,dateadd(dd,number,@sdate) as date1,@sTime,@eTime from master..spt_values where type='p' and number between 0 and datediff(dd,@sdate,@edate) update Playlist set ftype=a.type,path=a.path from files a where a.[filename]=@File1 and a.[filename]=Playlist.[filename] end exec dbo.makeplaylist1('vedio.avi','2012-5-1','2012-5-15','10:30','11:30') //报错