查询在 SQL Server 2005 中有效,但在 SQL Server 2000 中出现语法错误 [英] Query works in SQL Server 2005 but syntax error for SQL Server 2000

查看:41
本文介绍了查询在 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.

这篇关于查询在 SQL Server 2005 中有效,但在 SQL Server 2000 中出现语法错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆