Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

create database script - sql server 2000 compatible

Posted on 2009-06-27
5
Medium Priority
?
1,509 Views
Last Modified: 2012-05-07
I am running Sql Server Management Studio Express 2005 and have a database that I need to install on a remote sql server box running Sql Server 2000 (8.0.194).

I am connected to the remote server thru the Object Explorer.  I though the easiest way to recreate the database was to script the database and tables and then load the data.  However, when I tried to run the create database script I got the following errors:

Msg 102, Level 15, State 6, Line 1
Incorrect syntax near 'ENABLE_BROKER'.
Msg 102, Level 15, State 6, Line 1
Incorrect syntax near 'AUTO_UPDATE_STATISTICS_ASYNC'.
Msg 102, Level 15, State 6, Line 1
Incorrect syntax near 'DATE_CORRELATION_OPTIMIZATION'.
Msg 102, Level 15, State 6, Line 1
Incorrect syntax near 'TRUSTWORTHY'.
Msg 102, Level 15, State 6, Line 1
Incorrect syntax near 'ALLOW_SNAPSHOT_ISOLATION'.
Msg 102, Level 15, State 6, Line 1
Incorrect syntax near 'PARAMETERIZATION'.
Msg 102, Level 15, State 6, Line 1
Incorrect syntax near 'CHECKSUM'.
Msg 102, Level 15, State 6, Line 1
Incorrect syntax near 'DB_CHAINING'.

Here is my create database script:






USE [master]
GO
/****** Object:  Database [databasename]    Script Date: 06/27/2009 13:56:20 ******/
CREATE DATABASE [databasename] ON  PRIMARY
( NAME = N'databasename', FILENAME = N'c:\Program Files (x86)\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\databasename.mdf' , SIZE = 2048KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
 LOG ON
( NAME = N'databasename_log', FILENAME = N'c:\Program Files (x86)\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\databasename_log.ldf' , SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
 COLLATE SQL_Latin1_General_CP1_CI_AS
GO
EXEC dbo.sp_dbcmptlevel @dbname=N'databasename', @new_cmptlevel=80
GO
IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
begin
EXEC [databasename].[dbo].[sp_fulltext_database] @action = 'enable'
end
GO
ALTER DATABASE [databasename] SET ANSI_NULL_DEFAULT OFF
GO
ALTER DATABASE [databasename] SET ANSI_NULLS OFF
GO
ALTER DATABASE [databasename] SET ANSI_PADDING OFF
GO
ALTER DATABASE [databasename] SET ANSI_WARNINGS OFF
GO
ALTER DATABASE [databasename] SET ARITHABORT OFF
GO
ALTER DATABASE [databasename] SET AUTO_CLOSE OFF
GO
ALTER DATABASE [databasename] SET AUTO_CREATE_STATISTICS ON
GO
ALTER DATABASE [databasename] SET AUTO_SHRINK OFF
GO
ALTER DATABASE [databasename] SET AUTO_UPDATE_STATISTICS ON
GO
ALTER DATABASE [databasename] SET CURSOR_CLOSE_ON_COMMIT OFF
GO
ALTER DATABASE [databasename] SET CURSOR_DEFAULT  GLOBAL
GO
ALTER DATABASE [databasename] SET CONCAT_NULL_YIELDS_NULL OFF
GO
ALTER DATABASE [databasename] SET NUMERIC_ROUNDABORT OFF
GO
ALTER DATABASE [databasename] SET QUOTED_IDENTIFIER OFF
GO
ALTER DATABASE [databasename] SET RECURSIVE_TRIGGERS OFF
GO
ALTER DATABASE [databasename] SET  ENABLE_BROKER
GO
ALTER DATABASE [databasename] SET AUTO_UPDATE_STATISTICS_ASYNC OFF
GO
ALTER DATABASE [databasename] SET DATE_CORRELATION_OPTIMIZATION OFF
GO
ALTER DATABASE [databasename] SET TRUSTWORTHY OFF
GO
ALTER DATABASE [databasename] SET ALLOW_SNAPSHOT_ISOLATION OFF
GO
ALTER DATABASE [databasename] SET PARAMETERIZATION SIMPLE
GO
ALTER DATABASE [databasename] SET  READ_WRITE
GO
ALTER DATABASE [databasename] SET RECOVERY SIMPLE
GO
ALTER DATABASE [databasename] SET  MULTI_USER
GO
ALTER DATABASE [databasename] SET PAGE_VERIFY CHECKSUM  
GO
ALTER DATABASE [databasename] SET DB_CHAINING OFF

Is there an easier way to create the database on the remote server?  I don't have access to remote desktop into the server and place a backup on the drive and then restore or place the .mdf file and attach.  I have to create the database locally from within SQL Server Management Studio Express 2005 object explorer.

Any help is appreciated.
Thanks.
0
Comment
Question by:-Dman100-
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 24728890
you should, instead of developing on a sql 2005 instance, develop on the sql 2000 instance, avoiding all these problems. upgrading is much easier than downgrading.
so, my suggestion is:
install sql 2000 express edition/msde as a named instance (on the same box), and you can still use the sql 2005 management studio to connect to it.
0
 
LVL 22

Assisted Solution

by:8080_Diver
8080_Diver earned 1000 total points
ID: 24729082
In looking at your script . . . what are you setting ENABLE_BROKER , etc., to?  You have specified an ON/OFF setting for the other things but nothing for those. ;-)
0
 
LVL 22

Assisted Solution

by:8080_Diver
8080_Diver earned 1000 total points
ID: 24729085
You might want to try using Management Studio to script out the databse  that you have created and then look at the script that it generates and see how it looks. ;-)
0
 
LVL 23

Assisted Solution

by:Racim BOUDJAKDJI
Racim BOUDJAKDJI earned 500 total points
ID: 24729188
In addition to angelIII's sound advice...

Actually the message error tells you exactly that the options that are unknown in a SQL 2000 compatible environment.  Simply take them away from the script and re run
0
 

Author Comment

by:-Dman100-
ID: 24729322
Thanks guys...I was able to use Sql Publishing Wizard to target sql server 2000 and script out the schema and data.  It worked like a charm.  I appreciate the suggestions though.

Regards.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

618 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