I have side by side msde2000 and sqlexpress installed. I need to move a db that has been detached from msde2000 and where it works perfectly fine into sql express. After I select the .mdf file to attach I get this error:
TITLE: Microsoft SQL Server Management Studio
Attach database failed for Server 'LTBAHIA\SQLEXPRESS'. (Microsoft.SqlServer.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.ConnectionInfo)
SQL Server detected a logical consistency-based I/O error: torn page (expected signature: 0x55555555; actual signature: 0x55555551). It occurred during a read of page (1:97) in database ID 6 at offset 0x000000000c2000 in file 'C:\Memo2005\Diary\MEMO\bin\MEMOsql.mdf'. Additional messages in the SQL Server error log or system event log may provide more detail. This is a severe error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online.
Converting database 'MEMOsql' from version 539 to the current version 611.
Database 'MEMOsql' running the upgrade step from version 539 to version 551. (Microsoft SQL Server, Error: 824)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=824&LinkId=20476
BUTTONS:
OK
Thanks for any help,
Luis
The error is indicating a corruption of your databasefile. Could you run the suggested DBCC CHECKDB?
WesleyB
Visit my SQL Server weblog @. http://dis4ea.blogspot.com
|||The database is either not consistent or was not shutdown down / dettached the right way. Attach the database to SQL Server 2000 again, run CHECKDB, dettach is with either a command or the GUI and run attach it on the SQL Server Express, once beginning the attach process, the server will do an automatic conversion process which will need the database is a concistent state. if this does not work, try to make a backup on the SQL 2k database and restore it on the 2k5 (Express) server.
Jens K. Suessmeyer.
http://www.sqlserver2005.de
|||I have been trying to run CHECKDB but since it requires to have sql server in single user mode I have not been able to do it. If I start from a comand console with sqlservr -m and then I go to
Query Analyzer and try to connect to the server it refuses because it is in single user mode. It seems like a catch 22. Is there a way to start sql server in single user mode from within Sql Analyzer or Enterprise? Or better, how can I do the CHECKDB without running in these problems.
Thanks,
Luis
|||Unless you do not use any REPAIR commands you do not have to have the db in single user mode only. If you want to set the USER DATABASE in single user mode, you do not have to start the server in single user mode. Just use the command
EXEC sp_dboption 'DATABASENAME', 'single user', 'TRUE'
-Or (for sql 2k5)
ALTER DATABASE DbName SET SINGLE_USER
Jens K. Suessmeyer.
http://www.sqlserver2005.de
|||Thank you very much Jens. After a few tries it worked and now I have the DB converted.
Luis
No comments:
Post a Comment