Create procedure p1 (@v1 float,@v2 float,@date varchar(7),@c1 varchar(20),@c2 varcha(20))
as......
select *,IDENTITY(int,1,1) as myid
into #g from table1 where convert(char(7),date,120)=@date and id in (@c1,@c2)
..........................................
检查语法时,提示
服务器: 消息 137,级别 15,状态 2,行 5
必须声明变量 '@date'。
怎么回事,如何解决?存储过程的参数要怎么声明才行?
as......
select *,IDENTITY(int,1,1) as myid
into #g from table1 where convert(char(7),date,120)=@date and id in (@c1,@c2)
..........................................
检查语法时,提示
服务器: 消息 137,级别 15,状态 2,行 5
必须声明变量 '@date'。
怎么回事,如何解决?存储过程的参数要怎么声明才行?
@v1 float,@v2 float,@date varchar(7),@c1 varchar(20),@c2 varcha(20)
as......
asdelete from table1 where kid not in (select distinct kid from table2)select *,IDENTITY(int,1,1) as myid
into #g from table1 where convert(char(7),date,120)=@date and id in (@c1,@c2)把中间的delete去掉就能通过语法检查,为什么?