查询在 SQL Server 2005 中有效,但在 SQL Server 2000 中出现语法错误
问题描述:
我正在尝试执行此查询,但是当它与 SQL Server 2005 完美配合并且表已经存在并且我正在尝试在不同的服务器上创建新表时出现语法错误,
I am trying to execute this query but getting syntax error when it perfectly fines with SQL server 2005 and table is already there and am trying to create new table on a different server,
USE [myDataBase]
GO
CREATE TABLE [dbo].[myTable]
(
[ID] [int] IDENTITY(1,1) NOT NULL,
[Tittle] [varchar](1024) NOT NULL,
[Description] [varchar](8000) NOT NULL,
[Table2ID] [int] NOT NULL,
[Table3ID] [int] NOT NULL,
CONSTRAINT [PK_myTable] PRIMARY KEY CLUSTERED
(
[ID] ASC
)
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 80) ON [PRIMARY]
) ON [PRIMARY]
GO
错误
消息 170,级别 15,状态 1,第 16 行第 16 行:附近的语法不正确'('.
Msg 170, Level 15, State 1, Line 16 Line 16: Incorrect syntax near '('.
在上面的例子中,第 16 行是空的,我很困惑.
答
WITH
在 SQL Server 2000 中只允许设置 FillFactor
.请参阅文档:
WITH
in SQL Server 2000 allows only FillFactor
to be set. See the documentation:
http://msdn.microsoft.com/en-us/library/aa258255%28v=sql.80%29.aspx
从 WITH
子句中删除其他选项.
Remove other options from the WITH
clause.