【发布时间】:2010-11-23 00:15:42
【问题描述】:
这是我犯奇怪错误的日子。
我使用一个数据库项目,作为部署后的一部分,我们使用 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 的词。但是我得到了那个错误..
消息 102,第 15 级,状态 1,第 234 行
“OFFSET”附近的语法不正确。
这是怎么回事?
【问题讨论】:
-
只是一个想法,但您检查过它为此运行的脚本吗?
-
@Phil:我检查了整个 SQL 目录中的 OFFSET 一词,但在任何地方都没有找到。
标签: sql sql-server tsql ssms sqlcmd