一个创建表的错误大家看看
USE [HRSYSDB]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[SYS_Department](
[NodeID][int]IDENTITY(1,1)NOT NULL,
[NodeName_CN][nvarchar](200) COLLATE Chinese_PRC_CI_AS NULL,
[ParentNodeID][int] NULL,
[NodeCode][nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
[NodeType][int] NULL,
[NodeIDPath][nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL,
[CreateDate][datetime] NULL,
[NodeName_EN][nvarchar](200) COLLATE Chinese_PRC_CI_AS NULL,
[ModifyUserID][int] NULL,
[NodeDesc][nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL,
[EmployeeNumber][int] NULL,
[CreateUserID][int] NULL,
[ModifyDate][datetime] NULL,
[SonNodeNumber][int] NULL,
[IsActive][bit] NULL,
[AssessID][int] NULL,
CONSTRAINT [XPKSYS_Department] PRIMARY KEY CLUSTERED
(
[NodeID] ASC
)WITH(IGNORE_DUP_KEY=OFF) ON [PRIMARY]
)ON [PRIMARY]
报错Line 21: Incorrect syntax near '( '.
就是)WITH(IGNORE_DUP_KEY=OFF) ON [PRIMARY]这个地方大家帮忙看看。
------解决方案----------------------删除
WITH(IGNORE_DUP_KEY=OFF)
------解决方案--------------------主键没有 IGNORE_DUP_KEY 选项,意思是“忽略重复健”。
唯一性索引才有这个选项。