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

帮我解决一下了,很急~~~~~~!!
create   proc   PreparforBusiness--营业数据预备
    @OnShowDate   varcher(20)
as
begin   tran
    update   OnShowPlan   set   OnShowNOP=OnShowNOP-4   where   OnShowNOP> 3
    insert   into   HistoryRecords(FilmID,CinemaID,TheaterID,OnShowNOP,SingleTickets,BoxTickets,BoxOfficeIntake)
        values   (select   FilmID,CinemaID,TheaterID,OnShowNOP,SingleTickets,BoxTickets,Intake   from   SaleTodayInf   )
    delete   SaleTodayInf
    insert   into   SaleTodayInf   values   (select   *   from   SaleTomorrowInf)
    Update   SaleTodayInf   set   OnShowNOP=OnShowNOP-4
    delete   SaleTomorrowInf
    insert   into   SaleTomorrowInf   values   (select   *   from   SaleThirddayInf)
    Update   SaleTomorrowInf   set   OnShowNOP=OnShowNOP-4
    delete   SaleThirddayInf
    insert   into   SaleThirddayInf     values(select   OnShowPlan.OnShowIndex,OnShowPlan.TheaterID,OnShowPlan.CinemaID,OnShowPlan.FilmID,OnShowPlan.OnShowNOP,CinemaInf.SingleSeat,
                                                                            CinemaInf.Boxes   from   OnShowPlan,CinemaInf
                  where   OnShowPlan.OnShowNOP=8   or   OnShowPlan.OnShowNOP=9   or   OnShowPlan.OnShowNOP=10   or   OnShowPlan.OnShowNOP=11   and   OnShowPlan.CinemaID=CinemaInf.CinemaID)
go


服务器:   消息   156,级别   15,状态   1,过程   PreparforBusiness,行   7
在关键字   'select '   附近有语法错误。
服务器:   消息   170,级别   15,状态   1,过程   PreparforBusiness,行   7
第   7   行:   ') '   附近有语法错误。
服务器:   消息   156,级别   15,状态   1,过程   PreparforBusiness,行   9
在关键字   'select '   附近有语法错误。
服务器:   消息   170,级别   15,状态   1,过程   PreparforBusiness,行   9
第   9   行:   ') '   附近有语法错误。
服务器:   消息   156,级别   15,状态   1,过程   PreparforBusiness,行   12
在关键字   'select '   附近有语法错误。
服务器:   消息   170,级别   15,状态   1,过程   PreparforBusiness,行   12
第   12   行:   ') '   附近有语法错误。
服务器:   消息   156,级别   15,状态   1,过程   PreparforBusiness,行   15
在关键字   'select '   附近有语法错误。
服务器:   消息   170,级别   15,状态   1,过程   PreparforBusiness,行   17
第   17   行:   ') '   附近有语法错误。

------解决方案--------------------
insert into HistoryRecords(FilmID,CinemaID,TheaterID,OnShowNOP,SingleTickets,BoxTickets,BoxOfficeIntake)
values (select FilmID,CinemaID,TheaterID,OnShowNOP,SingleTickets,BoxTickets,Intake from SaleTodayInf )
改为
insert into HistoryRecords(FilmID,CinemaID,TheaterID,OnShowNOP,SingleTickets,BoxTickets,BoxOfficeIntake)
select FilmID,CinemaID,TheaterID,OnShowNOP,SingleTickets,BoxTickets,Intake from SaleTodayInf

其他的错误相同
------解决方案--------------------