Solved

SQL 2000 Script

Posted on 2011-09-13
4
241 Views
Last Modified: 2012-05-12
I need to create this table in my SQL 2000 database but it fails on the contraints beecause they are not supported in 2000.

How can I rewrite this to work or how can I add these contraints to the table if I strip all those off and manually add them?

USE [demodata]
GO

/****** Object:  Table [dbo].[SynSync]    Script Date: 09/13/2011 11:56:19 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[SynSync](
	[TableName] [varchar](20) NOT NULL,
	[KeyValue1] [varchar](80) NOT NULL,
	[KeyValue2] [varchar](80) NOT NULL,
	[KeyValue3] [varchar](80) NOT NULL,
	[KeyValue4] [varchar](80) NOT NULL,
	[KeyValue5] [varchar](80) NOT NULL,
	[Event] [char](10) NOT NULL,
	[EventTime] [datetime] NOT NULL,
 CONSTRAINT [PK_SynSync] PRIMARY KEY CLUSTERED 
(
	[TableName] ASC,
	[KeyValue1] ASC,
	[KeyValue2] ASC,
	[KeyValue3] ASC,
	[KeyValue4] ASC,
	[KeyValue5] 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
GO

Open in new window

0
Comment
Question by:red_75116
4 Comments
 
LVL 17

Accepted Solution

by:
Kent Dyer earned 500 total points
ID: 36530940
What you can do is to auto-generate the table build script by right-clicking on the table.  Be sure to use the dependencies and triggers, constraints, etc.  Part of the build script should include drops and adds for the SQL script.

Thanks,

Kent
0
 

Author Comment

by:red_75116
ID: 36530955
This loads in 2008 fine, but fails running in 2000.  that is the issue
0
 
LVL 42

Expert Comment

by:dqmq
ID: 36531008
I believe the WITH clause is causing you difficulty. Omit this part:

WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON)
0
 
LVL 23

Expert Comment

by:wdosanjos
ID: 36531038
Please try the following:

USE [demodata]
GO

/****** Object:  Table [dbo].[SynSync]    Script Date: 09/13/2011 11:56:19 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[SynSync](
	[TableName] [varchar](20) NOT NULL,
	[KeyValue1] [varchar](80) NOT NULL,
	[KeyValue2] [varchar](80) NOT NULL,
	[KeyValue3] [varchar](80) NOT NULL,
	[KeyValue4] [varchar](80) NOT NULL,
	[KeyValue5] [varchar](80) NOT NULL,
	[Event] [char](10) NOT NULL,
	[EventTime] [datetime] NOT NULL,
 CONSTRAINT [PK_SynSync] PRIMARY KEY CLUSTERED 
(
	[TableName],
	[KeyValue1] ,
	[KeyValue2] ,
	[KeyValue3] ,
	[KeyValue4] ,
	[KeyValue5] 
) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

Open in new window

0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
I have a large data set and a SSIS package. How can I load this file in multi threading?
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

912 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now