سؤال

I created a database in SQL Server 2008. I detached the database and I copied the .mdf over to the server, which is running SQL Server Enterprise Manager (SQL Server 2000).

When I try to attach the MDF I get...

Microsoft SQL-DMO (ODBC SQL State: HY000) Error 602: Could not find row in sysindexes for database ID 13, object ID 1, index ID 1. Run DBCC CHECKTABLE on sysindexes.

What does this mean? Is this because the db was created in a newer version?

هل كانت مفيدة؟

المحلول

From the documentation on the (I believe depreciated, but used in SQL Server 2000) sp_attach_db stored proc:

A database created by a more recent version of SQL Server cannot be attached in earlier versions.

I think you'll have to script the schema and data of your database.

Pinal Dave has a good tutorial on how to do this here - just remember to make sure you choose the following settings:

Under General:

  • Script for server version: SQL Server 2000

Under Table/View options:

  • Script data: True

Remember to double check the settings for any others you might be interested in, such as foreign keys, triggers etc.

نصائح أخرى

This is do-able, but you'd need to convert it to the SQL 2000 format before detaching it and attaching it on the old server. Here are the steps:

In entreprise manager, right click the database

Choose properties

On the left, click Options

Change the "Compatibility Level" to SQL Server 2000 (80)

Then save, and detach before reattaching on the old server.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top