USE [DatabaseName]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[TableName](
[ID] [int] IDENTITY(1,1) NOT NULL,
[URL] [varchar](max) NOT NULL,
[User] [varchar](1000) NOT NULL,
[Time] [datetime] NOT NULL,
CONSTRAINT [PK_TableName] PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
它适用于 SQL Server 2005 的开发环境,但不适用于 SQL Server 2012 并出现此错误,
消息 170,级别 15,状态 1,第 3 行第 3 行:“max”附近的语法不正确。
编辑
2012 实际上是 2000,但网络管理员做了一些事情,以便我可以使用 2012 管理工具工作室连接到它