0
我有一個腳本,沒有11線問題的降臨時表
Declare c Cursor For Select Distinct InvestmentId From dbo.Investment
Open c
DECLARE @InvestmentIdTemp INT
Fetch next From c into @InvestmentIdTemp
While @@Fetch_Status=0 Begin
Declare @tablevar table(col1 DATETIME)
insert into @tablevar(col1) EXEC dbo.CalculateActualUpdateDate @InvestmentIdTemp
UPDATE dbo.InvestmentData SET ActualUpdateDate =(SELECT TOP 1 col1 FROM @tablevar) WHERE [email protected]
DROP table @tablevar
Fetch next From c into @InvestmentIdTemp
End
Close c
Deallocate c
工作,我有一個錯誤:
Msg 102, Level 15, State 1, Line 11
Incorrect syntax near '@tablevar'.
我怎樣才能刪除該表?