這是我一天發生奇怪的錯誤。SQLCMD模式下的SSMS - 錯誤語法
我使用數據庫項目並且作爲Post部署的一部分,我們使用SQL腳本來填充表中的數據。
alter authorization on database::atlas to sa;
go
ALTER DATABASE ATLAS SET MULTI_USER WITH ROLLBACK IMMEDIATE;
GO
:r C:\Scripts\Script.DisableTriggers.sql
:r C:\Scripts\dbo\Script.dbo.PaymentMethod.sql
:r C:\Scripts\dbo\Script.dbo.TransactionEntryMethod.sql
:r C:\Scripts\dbo\Script.dbo.TransactionTypeGroup.sql
:r C:\Scripts\dbo\Script.dbo.TransactionType.sql
:r C:\Scripts\Script.EnableTriggers.sql
這些腳本非常相似,下面的一個
SET IDENTITY_INSERT [dbo].[TransactionTypeGroup] ON
INSERT INTO [dbo].[TransactionTypeGroup] (TransactionTypeGroupID,TransactionTypeGroupName) VALUES
(1,'Inquiry')
, (2,'Points')
, (3,'Board')
, (4,'Guest Meals')
, (5,'Cash Equivalency')
, (6,'Deposits')
, (7,'Void/Void Tender')
, (8,'Refund')
SET IDENTITY_INSERT [dbo].[TransactionTypeGroup] OFF
GO
當我把我的輸出後,我得到以下錯誤:
(1 row(s) affected)
(1 row(s) affected)
(25 row(s) affected)
(11 row(s) affected)
(2 row(s) affected)
(598 row(s) affected)
(3 row(s) affected)
Msg 102, Level 15, State 1, Line 234
Incorrect syntax near 'OFFSET'.
我已搜查我的整個SQL目錄,並且在任何SQL文件或我發佈的任何命令中都沒有稱爲OFFSET的單詞。但是我得到那個錯誤..
Msg 102,Level 15,State 1,Line 234
'OFFSET'附近語法不正確。
這是怎麼回事?
只是一個想法,但你檢查了它爲此運行的腳本? – 2009-08-26 13:49:15
@Phil:我檢查了我的整個SQL目錄中的OFFSET這個詞,並沒有在任何地方找到它。 – 2009-08-26 14:18:38