高手请教
我从服务器里的tongcard_test这个数据库里把其中一个表导成sql,然后在本机新建一个数据库名为tongcard_test,然后我在查询分析器里执行导出的sql去总报错
sql脚本:
USE [tongcard_test]
GO
/****** 对象: Table [dbo].[t_userRegisterLog] 脚本日期: 06/01/2007 10:18:11 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[t_userRegisterLog](
[id] [bigint] IDENTITY(1,1) NOT NULL,
[user_loginName] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL,
[user_email] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL,
[register_time] [datetime] NULL,
[activity_time] [datetime] NULL,
[detail] [varchar](300) COLLATE Chinese_PRC_CI_AS NULL,
[state] [int] NULL,
CONSTRAINT [PK_T_USERREGISTERLOG] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY] //此处就是提示的错误地方
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
错误:
服务器: 消息 170,级别 15,状态 1,行 12
第 12 行: '( ' 附近有语法错误。
------解决方案--------------------创建表时不可以使用IGNORE_DUP_KEY吧
------解决方案--------------------USE [tongcard_test]
GO
/****** 对象: Table [dbo].[t_userRegisterLog] 脚本日期: 06/01/2007 10:18:11 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[t_userRegisterLog](
[id] [bigint] IDENTITY(1,1) NOT NULL,
[user_loginName] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL,
[user_email] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL,
[register_time] [datetime] NULL,
[activity_time] [datetime] NULL,
[detail] [varchar](300) COLLATE Chinese_PRC_CI_AS NULL,
[state] [int] NULL,
CONSTRAINT [PK_T_USERREGISTERLOG] PRIMARY KEY CLUSTERED
(
[id] ASC
)---WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY] //这个地方只能在2005上用,2000下不认,把 with 注释掉就可以了。
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF