Link to home
Start Free TrialLog in
Avatar of Tom Knowlton
Tom KnowltonFlag for United States of America

asked on

Error attaching to database version 612 vs the MDF and LDF are from 655?

TITLE: Microsoft SQL Server Management Studio Express
------------------------------

Attach database failed for Server 'KNOWLTON-PC\SQLEXPRESS'.  (Microsoft.SqlServer.Express.Smo)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.3042.00&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.Express.ConnectionInfo)

------------------------------

The database 'Nitrobids' cannot be opened because it is version 655. This server supports version 612 and earlier. A downgrade path is not supported.
Could not open new database 'Nitrobids'. CREATE DATABASE is aborted. (Microsoft SQL Server, Error: 948)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=948&LinkId=20476





I have tried to upgrade to SP3.  The install seems to go okay...no errors....but it still says Service Pack 2 when I do this:


select @@version


in the query editor


(Full results:)

Microsoft SQL Server 2005 - 9.00.4035.00 (Intel X86)   Nov 24 2008 13:01:59   Copyright (c) 1988-2005 Microsoft Corporation  Express Edition on Windows NT 6.0 (Build 6002: Service Pack 2)
ASKER CERTIFIED SOLUTION
Avatar of Jason Yousef
Jason Yousef
Flag of United States of America 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
Avatar of Tom Knowlton

ASKER

The biggest concern (for my situation) is that I am able to open the MDF file I have been sent.

Apparently it was created under a version more updated than mine.  655 vs my version is 612.

Do those numbers mean anything to you?

Is SQL Server 2008 the same as 655?


In the meantime....I will install 2008 R2 as you recommend.

Something does not make sense,
Are you using Visual Studio..? IF yes then make sure you have latest service packs for your version of Visual Studio (e.g. Service pack 1 for VS 2008)

The error message is saying that  MDF you are trying to attach is created in the later version of SQL Server then what you currently have.  

This can happen if you are trying to attach a 2008 database in SQL 2005 but I don't think that is the case.

Yes 2008 R2 should import any other erlier versions.
make sure to uninstall first, so the new instance gets the same name "SQLEXPRESS"
I've moved on from the 612 vs 655 version problem now  (thank you so much).

It did require a complete uninstall and reinstall (which takes forever, but it was worth it).

NOW it is complaining that the MDF file is Read Only  (can you believe it?)

I checked the file attributes, and the Read Only attribute is NOT checked.

Any help, huslayer?
Well I'm a nice guy, I can beleive anything :)
so did you attach it and it's showing as grey colored - read only, or you can't attach it at all ?


Anyway, i never had that before, but could due to many reasons.

1-Make sure the file's properities are not read only --- Done
2-Make sure the SQL account has read and write to the directory (can you create new DBs?)
3-Make sure the volume c:\ or D:\ or whatever is not compressed or encrypted
4-if you're using the "NETWORK SERVICE" account- so try adding it with read-write permissions on the database to the folder where the mdf and log files are located.
5-try to attach using this command ---->   exec sp_attach_db 'yourdbname' ,'X:\Mssql\Data\yourdb.mdf'
6-last resort

Run

 

select is_read_only, *From sys.databases

select databaseproperty('testdb','isreadonly')

 

IF the above statement return 1 , then the database is set as readonly.

 

Run the following statement to make it as read-write

 

alter database testdb set READ_WRITE

 

test and tell me ...

 
No, it will not attach, at all.

I can create a new database and add a table to it.


Here is a screenshot of the exact error I am getting:
readonlyattachdenied.jpg
any of the abpve steps worked?
did you try steps 2 to 5 ?
do you wanna send me the DB to try to attach it or it has sensetive data? you can use my personal e-mail huslayer@hotmail.com
 
I would send the files...but they are quite large.

Plus, yeah...they do have sensitive information...names...addresses, etc.


What would it take to MAKE this error occur in an MDF and LDF that are working?
The files belongs to sql 2000 and was a read only or wasn't de-ttached correct, was just copied, and while sql 2008 attaching them it needs to upgrade them, and hence it's read only sql fails.
the last hope is to attach them to sql 2000 which I have.
Don't how can I help further...
Thx.  Although my problem is not solved, I no longer believe it to be fixable on my end.  I believe the original sender of the database files needs to resend them.  You did answer my original question.  Thank you, huslayer
Sorry really to hear that and I still want to help.

I can get SQL 2000 evaluation CD, do you want me to upload it and you try to install it and attach the DB again?
Give me a few weeks and I will know better if I need to pursue this more.

I suspect that what may have happened was the database was in use while being copied.  Could this be causing the problem?

My situation is I am working on a website that connects to a database.  I am trying to setup a local version on my laptop.  They provided me with a copy of the database (90+ mb).  They gave me a MDF and an LDF file.  

This may all be moot.  I have delivered the code and I am just waiting to see if they have any tweaks or feedback for me.  In essence I am saying...there is a possibility I am done with the project.

But yes...I'll come back and post if I think I need more help.  

I appreciate all of your time and effort, and willingness to continue helping.

Tom
Tom,
No problem, anytime, Best of luck.

Hussein