Feb 1

Written by: Dylan Barber
2/1/2010 4:42 PM  RssIcon

Okay guess Microsoft never figured someone would want to restore something from SQL Server 2008 to 2005 so its not that intuitive to do.  Here’s a, mostly, tested way to do it.

1) Start convert wizard

Open SQL Server Management Studio2008. in 'Object Explorer', right click the database that you want to convert. Select 'Tasks' > 'Generate Scripts...'.

 

ConvertSQL2008_To_2005_1

2) Next

Click 'Next'.

ConvertSQL2008_To_2005_2

3) Select database and objects

Select the database that you want to convert, and check on 'Scripts all objects in the selected databases'

 

ConvertSQL2008_To_2005_3

 

4) Convert Options

Set options:

'Script for Server Version' = 'SQL Server 2005'
'Script Data' = 'True'
'Script Database Create' = 'True'
ConvertSQL2008_To_2005_3_1 
5) Output Option

Select option 'Script to file', 'Single file' and 'Unicode text'.

ConvertSQL2008_To_2005_4     
6) 'Finish'

View summary and click 'Finish'.

ConvertSQL2008_To_2005_5

7) Result

Now you got a complete database creation script with data. It can be executed on target database server.

ConvertSQL2008_To_2005_6

 

8) Amend Script

Open the generated script in SQL Server Management Studio 2005. Find the following section and amend the path to proper data folder

 

    CREATE DATABASE [StockTraderDB] ON  PRIMARY 
( NAME = N'StockTraderDB', 
FILENAME = N'c:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\StockTraderDB.mdf ,
 SIZE = 4352KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
 LOG ON 
( NAME = N'StockTraderDB_log', 
FILENAME = N'c:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\StockTraderDB_log.LDF',
 SIZE = 6272KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)

9) Execute the Script

When finished, You should get converted database of SQL Server 2005

Originally from http://www.devx.com/dbzone/Article/40531/0/page/1


Your name:
Gravatar Preview
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Security Code
Enter the code shown above in the box below
Add Comment   Cancel