?
Solved

create database script - sql server 2000 compatible

Posted on 2009-06-27
5
Medium Priority
?
1,506 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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

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.
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.
Suggested Courses

762 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