Query works in SQL Server 2005 but syntax error for SQL Server 2000

送分小仙女□ 提交于 2019-12-11 01:24:48

问题


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

Error

Msg 170, Level 15, State 1, Line 16 Line 16: Incorrect syntax near '('.

In above example, Line 16 is empty and am so confused.


回答1:


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

Remove other options from the WITH clause.



来源:https://stackoverflow.com/questions/17189251/query-works-in-sql-server-2005-but-syntax-error-for-sql-server-2000

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!