注册 登录
编程论坛 SQL Server论坛

存储错误,帮我看看吧

belong0204 发布于 2010-04-17 16:23, 487 次点击
create proc InquiryTO(@StartStop varchar(32),@EndStop varchar(32))
as
begin
     select
          sr1.Stop as 起始站点,
          sr2.Stop as 目的站点,
          sr1.Route as 乘坐线路,
          sr2.Position-sr1.Position as 经过的站点数
     from
         stop_route sr1,
         stop_route sr2
     where
         sr1.Route=sr2.Route
         and sr1.Position<sr2.Position
         and sr1.Stop=@StarStop
         and sr2.Stop=@EndStop
end  
错误提示:消息 137,级别 15,状态 2,过程 InquiryTO,第 18 行
必须声明标量变量 "@StarStop"。
2 回复
#2
cnfarer2010-04-17 19:12
写错了,应该是"@StartStop".上下要一致!!
     where
         sr1.Route=sr2.Route
         and sr1.Position<sr2.Position
         and sr1.Stop=@StarStop
         and sr2.Stop=@EndStop
#3
belong02042010-04-20 18:15
太感谢了,知道了。
1