Solved

Problems to open an mdf file on SQL Server 2003

Posted on 2004-08-30
7
425 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
[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
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
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 ?
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

690 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