Solved

Problems to open an mdf file on SQL Server 2003

Posted on 2004-08-30
7
419 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:ScottPletcher
ScottPletcher 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
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.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
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.

708 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now