日期:2014-05-18  浏览次数:20513 次

为什么我的存储过程报错?
求教..

SQL code

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')  //报错



------解决方案--------------------
@sdate varchar(10),@edate varchar(10)

改成DATETIME类型
------解决方案--------------------
贴出错误信息
------解决方案--------------------
@sdate datetime,@edate datetime,@sTime datetime,@eTime datetime