I have a sql server 2005 .
But my old customers have a sql 2000 database.
I want to create table script, and upgrade my custumers tables..
i script table in sql 2005 and run at sql 2000. but it doesnt work?
for example: sql 2005 create this 1uery on the test table:
"USE [test]
GO
/****** Object: Table [dbo].[TBL_TEST] Script Date: 11/24/2006 13:21:19 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TBL_TEST](
[ID] [int] IDENTITY(1,1) NOT NULL,
[KOLON1] [nchar](10) NULL,
[KOLON2] [nchar](10) NULL,
CONSTRAINT [PK_TBL_TEST] PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]"
then i run to sql 2000, but it doesnt work.
but when i convert manually this query, it works.
"
CREATE TABLE [dbo].[TBL_TEST](
[ID] [int] IDENTITY(1,1) NOT NULL,
[KOLON1] [nchar](10) NULL,
[KOLON2] [nchar](10) NULL
) ON [PRIMARY]
ALTER TABLE [dbo].[TBL_TEST] WITH NOCHECK ADD
CONSTRAINT [PK_TBL_TEST] PRIMARY KEY CLUSTERED
(
[ID]
) ON [PRIMARY]
"
SO i must convert sql 2000 format to this query. but i have a lot of table and always add new table . i could'nt change always.
How can i "script table as" at sql server 2005 to sql server 2000 compatibility?
You will find that there are some changes in the TSQL generated that will not work on sql 2000. But you should be able to have your database on the sql 2005 box run in sql 2000 compatability mode, then export the scripts... it should work then. You can change this setting in the Database properties.
|||thanks .but my 2005 database currently run on compatability mode:Sql server 2000 (80)
so it couldn't work..|||You might try a free app I wrote called scriptdb. It will script out all objects in your database, with a separate file for each. It's useful for getting all your objects into source control if they aren't already. The source code is freely available. get it here:
http://www.elsasoft.org/tools.htm
hope it helps!
|||I have used ScriptDB which is an useful one in this case, I can second Jezemine's reference.|||
I had a similar situation,
here is my SOLUTION.
If you are useing Microsoft SQL Server Management Studio Express
A. Select your Database in the Object Explorer
B. Right Click, to get your context menu and choose: Task -> Generate Scripts... ( this is the only one I know if this will work on )
C. Click the Next button
D. Select your DB from the list
E. About Halfway down the options list set "Script for Server Version" to "SQL Server 2000"
F. Next...
G. Select your DB objects and generate your scripts
the script will work in SQL 2000
No comments:
Post a Comment