Solved

Problems to open an mdf file on SQL Server 2003

Posted on 2004-08-30
7
422 Views
Last Modified: 2012-06-21
I have a mdf file: GestioneEventi.mdf created by SQL Server 7.0. Now I'm trying to open this file on SQL Server 2003 but the installation fails and this is the message that appears:'Error 1813 - Could not open new database 'GestioneEventi'. CREATE DATABASE is aborted.
Device activation error. The physical file name 'C:\Programmi\Microsoft SQL Server\MSSQL\data\GestioneEnti_Log.LDF' may be incorrect.'

If I try to use the old GestioneEnti.ldf  this is the message that I receive from the server: 'Error 5173 - Could not associate files with different databases' ( I've tried to open this file on SQL Server 2000 whith the same results).

What's the problem? How I can resolve this problem? Thanks
0
Comment
Question by:fbenve
  • 2
7 Comments
 
LVL 10

Expert Comment

by:Jay Toops
ID: 11931077
Instead of doing a backup and restore you need to
use a dts package to transfer the data from one database to annother
Using the Import data command from sql server 2003.

Jay

0
 
LVL 10

Accepted Solution

by:
Jay Toops earned 250 total points
ID: 11931132
According to this

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=3e897810_1%40news1.prserv.net

It is possible to do this

Also more specific info on the process can be found here

This is the process described by the sqlserver book online

Basically you can detach your SQL Server 7.0 database files (both the .mdf and the .ldf), make an operating system copy of them, and then attach them to the SQL Server 2000 instance. SQL Server 2000 will accept detached SQL Server 7.0 database files, and automatically convert them into SQL Server 2000 format.

Note that this moves all the database specific information ... tables, views, stored procedures, database users, etc. ... to the SQL Server 2000 instance, but does not move server specific information such as SQL Server logins. Thus you might have to execute the sp change users login system stored procedure on SQL Server 2000 to "re-synchronize" server logins and database users. Documentation on the sp change users login system stored procedure can be found in the SQL Server Books Online as well.

As an alternative you can
1. Backup and verify the database through Enterprise Manager and copy the file onto CD
2. Create a new database on the SQL 2000 server
3. Restore the newly created database using Enterprise Manager and selecting the "From Device" option which allows you to select a file not known to SQL server.

--JAY
0
 
LVL 34

Expert Comment

by:arbert
ID: 11931487
How are you trying to "open" the MDf in SQL2000?  Sp_attach_db?
0
 
LVL 69

Assisted Solution

by:Scott Pletcher
Scott Pletcher earned 250 total points
ID: 11935552
The easiest way is to create a backup, copy the backup file (usually .BAK) to the new server, then restore it to a new database name.  You will also need to re-create the logins and, if there any native SQL users, re-sync them using sp_change_users_login.

You can also do a detach from the old server, copy the .MDF and .LDF, then attach on the new server.  In theory you should be able to attach only the .MDF using sp_attach_db or sp_attach_single_file_db.
NOTE: Use QA to do the attach, *not* EM; *NEVER* use EM to detach or attach a db.
As before, you still need to re-create the logins and sync the SQL userids, if any.
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

839 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