Thursday, March 8, 2012

Convert Sql Server 2005 to Sql Server 2000

I have to downgrade a eCommerce database from Sql Server 2005 to Sql Server 2000 due to hosting server's support compatibility. Almost all features in the original (2005) version are available in 2000.

Any recommendations as on an easy conversion? Thanks a lot.

-Yubo

It's not possible to easily/directly convert a SQL Server 2005 database to SQL Server 2000. I learned this the very hard way. My suggestion would be to find a new host.|||I have the same issue, in that I developed an ASP.Net 2.0 application using SQL Server Express. Now I discover that my hoster, GoDaddy, offers only SQL Server 2K (plus Access and MySql). Although the DB is fairly basic, I don't want to manually recreate it. When I tried running a script of the DB (script created in SQL Server Express) in SQL Server 2K Query Analyzer, it failed with many errors. What a pain.|||

It is actually much easier than you think. Just use Sql Server Express to generate database script, with specification of compatibility set to "Sql Server 2000". Run the script in Sql Server 2000, you're all set.

Yubo

|||

I just tried it and it seems to work ... at least the tables and triggers appear in Enterprise Mgr. I need to take two steps before I'm home free:

(1) Do some basic Q/A attaching my app to SQL Server 2K (may have some "Personalization" DB issues).

(2) Upload it to my hoster (GoDaddy) and make sure it runs properly.

Thank you so much for pointing out this feature in SQL Server Express. I have spent many hours today trying to manually edit a script file, generated in SQL Server Express, in a futile attempt to get it to run in SQL Server 2K Query Analyzer. Thanks again; I really appreciate your help!

|||I had the same issue...tried what was suggested (changed the "Script for Server Version" to SQl Server 2000), but it didn't solve the problem...

Any other ideas? Are there any online sql conversion or validation tools that migt be useful?

Thanks|||

What issue are you having when running DB script in SS2K? Please list some details.

I don't know of any online sql conversion/validation tool.

-Yubo

|||

May be this will help !

How to Downgrade a Database from SQL Server 2005 to SQL Server 2000

Asyou may all know, SQL Server 2005 request a minimum of 8GB RAM to work…let say satisfactorily. I first didn't knew that and after a while fromthe upgrade I did from SQL Server 2000 to 2005 my SQL Services werestarting to crash three or four times per DAY!!!

Atfirst I thought I was being attacked, but soon I realized it wasnothing like that. I then decided to downgrade to an SQL Server 2000edition. Though I looked around the internet to find some informationon how to do that, I got very disappointed when I realized that noactual documentation of any kind could be found for that. So I amposting this thread to inform you on the procedures I had to follow forthis action.

Before beginning I must assume, firstly that the user, who will attempt such thing, has abasic knowledge of SQL Environment, secondly that he has the twoversions already installed (both 2000 and 2005), that a basic backup ofthe databases has been created and finally that all the 2005 SQL ServerUsers have been created at the SQL Server 2000 environment as well.

Step 1 Generating Scripts for the Database Elements and Structures

1) Right-click over the desired Database at 2005, Choose Tasks and the Generate Scripts (Option).

2) At the pop-up Dialog Box click at theScript All Objects in the selected Databases check box, to activate it and then Click the Next Button.

3) Set the following Elements to the following Values

a. Script Collation , set to TRUE

b. Script Database Create, set to TRUE

c. Script of SQL Version, set to SQL SERVER 2000

d. Script foreign keys, set to FALSE

e. Script Triggers, set to FALSE

Then Hit the Next button

4) Selectthe way the generated scripts should be saved (There are differentselections. The most common one is Clipboard). Finally click the Nextbutton till you reach the end.

5) Click Finish

Aftercompleting this procedure, we have to move to the SQL SERVER 2000environment. Here, by using the Query Analyzer, we will have to run thescripts that were generated using the master database. Copy and Pastethe script at the Query Analyzer and run it. After that the Structureof the Database will be created.

Becareful, the SQL Server 2005 Edition inserts the Views in a randomplace through the script. Therefore, all the scripts that are referredto the Views MUST be moved to the end of the script. If the QueryAnalyzer shows some errors do not be bothered. Delete all the elementscreated from the script and after you fix the code run it again.

Step2Moving the data from 2005 to 2000

1) Aftercompleting the previous step successfully, moving the data follows.Right-click at the 2005 database you used to run the previous step andselect Tasks and then choose the Export Data (option).

2) From the pop-up Dialog Box, select the Source Db and Click at the Next Button.

3) Atthe next step you will have to choose the destination server and thedestination Database for the Data to be exported. Then Click Next.

4) AList of all the Source Database's Elements will appear in the screen.Select one by one all the Elements you wish to move and for each oneclick at the button Edit Mappings (Located at the bottom right cornerof the Dialog Box just under the Elements list). A new Dialog box willpop-up. Select the Delete rows in Destination Tables option andactivate the Enable Identity Insert Option. (Remember to repeat thisaction for each of the selected Element from the list that will bemoved.

CAUTION!!!A malfunction of the SQL Server 2005 has been found. Not sure why,after multiple tries I have observed that when I tried to move morethan twelve Elements at once, the Export Data Wizard of SQL Server 2005seemed to disable the Enable Identity Insert Option that was activatedover the Edit Mappings Dialog Box. But if the number of the selectedElements is smaller than 12 no problem seemed to appear.

Step 3 Generating Scripts for the Database Foreign Keys and Triggers

Finally,to successfully finish the downgrade of the Database, the Triggers andthe Foreign Keys of the DB must be produced. The procedure that shouldbe followed is the one stated next:

1) Right-Click at the SQL 2005 Database and Select from Tasks Menu the Generate Scripts Option.

2) Using the pop-up Dialog Box make sure that the check boxScript All Objects in the selected Databases is not enabled and hit the Next Button.

3) Set all the Elements on the List to a False Value except the ones that follow:

a. Include IF NOT EXISTS , set to TRUE

b. Script Owner, set to TRUE

c. Script of SQL Version, set to SQL SERVER 2000

d. Script foreign keys, set to TRUE

e. Script Triggers, set to TRUE

Then Hit the Next button

4) Afterfinishing reading the Elements of the Database, a new list will appearat the Dialog Box. Make sure that you select ONLY THE TABLES of theDatabase and hit the Next Button.

5) At the screen that follows hit the Select All button and the Next.

6) Selectthe way the generated scripts should be saved (There are differentselections. The most common one is Clipboard). Finally click the Nextbutton till you reach the end.

7) Click Finish Button.

Aftercompleting this procedure, we have to move to the SQL SERVER 2000environment. Here, by using the Query Analyzer, we will have to run thescripts that were generated using the master database. Copy and Pastethe script at the Query Analyzer and run it. After that the ForeignKeys and the Triggers of the Database will be created.

After these steps the database should be fully functional under the SQL Server 2000 edition.


|||

Hi,

This is what I want. Thank for the suggestion. I will try it.

|||

Hi,

Here's how to upload a localSql Server Express .mdf database, complete with thetable data, usingVisual Web Developer 2008 Express, to aSql 2000 remote account!

1. Right-click the .mdf file in Databse Explorer in VWD. Choose Publish to Provider...

2. Click Next; Select your db and click Next, and Next again to simply put the resulting .sql file whereever Windows wants it.

3. Select the Sql Server 2000 option from the middle dropdown menu. This is the one which does the trick!

4. Follow the instructions to finish the guide.

5. Open Sql Management Studio Express (which you must have downloaded). Connect to the remote host's db account and find your "db". Right-click and choose New Query...

6. Find your .sql file in Windows Explorer. Right-click and choose Open with Sql Management Studio Express.

7. Copy the contents of your file into the empty "New Query... file". Click Execute or hit F5. Refresh the db pane of Sql Management Studio Express to view your changes.

That's it!

Pettrer, Sweden

No comments:

Post a Comment