Link to home
Start Free TrialLog in
Avatar of jason bradway
jason bradway

asked on

MDF File Association missin

Somehow I managed to disassociate the .mdf file extension with a SQL Server Database.  I have not been able to find anywhere to restore the association.  I have checked on other computers and they all indicate that the program is "unavailable"

This becomes a problem when I am trying to re-attach a database for upgrade purposes from 2000 to 2005 as it will not recognize it as a valid file format.

Do I have to go back into 2000 and script everything out in order to bring it into the higher versions of SQL?  I was hoping for a faster cleaner upgrade and not losing any of my table settings -- mostly my default field settings for the 75+ tables that are there.

My overall goal is to move everything over to SQL 2008 and my ADP's to 2007.  Anyone have suggestions?
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

>This becomes a problem when I am trying to re-attach a database ...

to reattach, you don't need file associations.
you just "attach", either via the sql server gui (context menu of the database folder), or the stored procedure sp_attach_db.

What do you mean, .MDF is not being recognized as a valid file format? Is the file a valid MDF that was properly detached from the 2000 server??

.MDF files are not associated with any explicit applications as such, provided the content is valid, SQL Server will be able to use the file when attached..

Have you tried backing up the database in SQL 2000 and restoring the backup to 2005/2008?
Avatar of jason bradway
jason bradway

ASKER

I detached the database from one server, copied it to my laptop which has Vista Ultimate and SQL 2005.  Vista Ultimate does not show that  an mdf is a SQL Database file.
Open the SQL Server Management Studio, connect to your local 2005 server on Vista In the dialog box displayed, Click 'Add' and browse to the MDF file to attach..
>Vista Ultimate does not show that  an mdf is a SQL Database file.
as mentioned, it does not matter. attaching the file to sql server is what matters.
>>I detached the database from one server, copied it to my laptop which has Vista Ultimate and SQL 2005. <<
I trust you did not miss copying the LDF as well or it will fail.
Yes, I have done all of the above as well and I receive the following error message

TITLE: Microsoft SQL Server Management Studio
------------------------------
Attach database failed for Server 'JAYSONBEE5\JAYSONBEE5'.  (Microsoft.SqlServer.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.0.1600.22+((SQL_PreRelease).080709-1414+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Attach+database+Server&LinkId=20476 
------------------------------
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
------------------------------
Unable to open the physical file "C:\DANBSQL_DATA\MedMaint_Data.MDF". Operating system error 5: "5(Access is denied.)". (Microsoft SQL Server, Error: 5120)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.00.1600&EvtSrc=MSSQLServer&EvtID=5120&LinkId=20476 
------------------------------

After getting the error message, I have tried the help links and they have no information and I cannot seem to find anything else understandable on the internet..
I havetaken the assumption that my databases originally had errors, so I went back to the originals and verified them to start all over again.  I still get the same message which is why I was assuming that it had more to do with the file association.
ASKER CERTIFIED SOLUTION
Avatar of reb73
reb73
Flag of Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Changing the permissions worked like a charm.  Thanks!!