• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 435
  • Last Modified:

Problems to open an mdf file on SQL Server 2003

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
fbenve
Asked:
fbenve
  • 2
2 Solutions
 
Jay ToopsCommented:
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
 
Jay ToopsCommented:
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
 
arbertCommented:
How are you trying to "open" the MDf in SQL2000?  Sp_attach_db?
0
 
Scott PletcherSenior DBACommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now