写的存储过程有语法错误
--存储过程InquiryT0create 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
错误原因是:消息 102,级别 15,状态 1,过程 InquiryTO,第 5 行
',' 附近有语法错误。