SQL Server - Problem attaching database - Asked By vipin1992 Gupta on 31-Jan-12 04:04 AM

HI,
The database is from SqlServer Express 2005.  I've created an instance
of SQLServer Express 2008 on another machine.  I did a shrink on the
db before copying it.

I get a message like
Server: Msg 602, Level 21, State 50, Line 1
Could not find row in sysindexes for database ID 17, object ID 1,
index ID 1
1. Run DBCC CHECKTABLE on sysindexes.

I am also getting same error pls if you have solution help me out.

Regards,
Vipin G\.
Sreekumar P replied to vipin1992 Gupta on 31-Jan-12 04:10 AM

Yes, that is the error you get when trying to attach a database that is from
a higher version of SQL Server

It sounds like you're trying to attach an SQL2005 database to an SQL2000 server
Suchit shah replied to vipin1992 Gupta on 31-Jan-12 04:12 AM
Based on the exception, it seems that you have created databases on SQL Server 2005 and tried to attach them with Enterprise Manager on SQL Server 2000.

As far as I know, this isn't possible; SQL Server is not compatible with later editions.

If you want to move the databases which were created on SQL Server 2005 to SQL Server 2000, you may use the "SQL Server Import and Export Wizard" to script out the table, view and stored procedure objects (assuming you don’t use any SQL Server 2005 features) and recreate them in SQL Server 2000, then create a "Snapshot Replication" between SQL Server 2005 instance and SQL Server 2000 instance to replicate the database data.
Riley K replied to vipin1992 Gupta on 31-Jan-12 04:13 AM


Refer this link

http://www.sql-questions.com/microsoft/SQL-Server-Programming/33723037/problem-attaching-database.aspx


Regards
smr replied to vipin1992 Gupta on 31-Jan-12 04:14 AM
hi

After ensure a good backup you can try:
DBCC Checkdb with option REPAIR_ALLOW_DATA_LOSS 


follow
http://www.sql-server-performance.com/forum/threads/could-not-find-row-in-sysindexes-for-database.7519/
D Company replied to vipin1992 Gupta on 31-Jan-12 04:15 AM
Hello Friend,

try these two options

Try using the GUI to attach the DB. 
In Object Explorer right click on Databases --> Attach --> Add --> browse to .mdf file and click ok --> you should see both the mdf and log file under Database Details.  Click ok.  If there is an error it should tell you what the error is.

or

run C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regsql.exe on your preferred database to install the asp_net tables/stored procs
      1) open any folder and paste in "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regsql.exe".  This will run the wizard.
      2) Next
      3) Next
      4)  Type "\SqlExpress" after the server name
      5)  Next
      6) Next
      7) Finish. 

Run DBCC CHECKTABLE on sysindexes check this link.
http://msdn.microsoft.com/en-us/library/ms174338.aspx

Regards
D
prathap chowdary replied to D Company on 01-Feb-12 03:15 AM
Hi,

Try it to another way apart from Attach method.

Try with restore method. first you will take a back up in source server and then copying into destination server then you will fire this commands............

restore verifyonly from disk='<backup path name>'.................it gives the validation of that back up file
then restore filelistonly from disk='<backup path name>'.......it gives the both logical and physical name as well as path names also.

then you restore with move option............

restore database <dbname> from disk='<Backup path name>'
with move '<logical mdf file name>' to '<desired path>',
move 'logical ldf file name' to '<desired path>',stats=1

May be this way you got result.......