Discussion:
Problem attaching database
(too old to reply)
cowznofsky
2008-12-22 14:27:57 UTC
Permalink
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 16, object ID 1,
index ID
1. Run DBCC CHECKTABLE on sysindexes.


(This is copied from a earlier post, but it's basically the same
message).

Any ideas?
I suppose I could just run that command on the source db, but it's in
production and working fine.

I then tried to restore a backup but got a message about too many
devices or files used (sorry I don't have the exact message here).
Erland Sommarskog
2008-12-22 16:19:36 UTC
Permalink
Post by cowznofsky
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 16, object ID 1,
index ID
1. Run DBCC CHECKTABLE on sysindexes.
(This is copied from a earlier post, but it's basically the same
message).
Basically the same message? Please post the exact error message. That
certainly could help you to get an accurate answer.

The error message above comes from SQL 2000, so my conclusion is that
you are trying to attach a database from SQL 2005/SQL 2008 on SQL 2000
and that is not going to work out.
--
Erland Sommarskog, SQL Server MVP, ***@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
cowznofsky
2008-12-24 20:39:33 UTC
Permalink
Post by Erland Sommarskog
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 16, object ID 1,
index ID
1. Run DBCC CHECKTABLE on sysindexes.
(This is copied from a earlier post, but it's basically the same
message).
Basically the same message? Please post the exact error message. That
certainly could help you to get an accurate answer.
The error message above comes from SQL 2000, so my conclusion is that
you are trying to attach a database from SQL 2005/SQL 2008 on SQL 2000
and that is not going to work out.
--
Books Online for SQL Server 2005 athttp://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books...
Books Online for SQL Server 2000 athttp://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
There is nothing here from SqlServer 2000. The database is from a
basic version of SQLServer Express 2005.
I am trying to attach it in SqlServer Express 2008 with Advanced
Services.

The precise error message is: "An exception occurred while executing a
Transact-SQL statement or batch.
Could not find row in sysindexes for database ID 6, object ID 1,
index ID 1
1. Run DBCC CHECKTABLE on sysindexes. "
Erland Sommarskog
2008-12-24 21:53:46 UTC
Permalink
Post by cowznofsky
There is nothing here from SqlServer 2000. The database is from a
basic version of SQLServer Express 2005.
I am trying to attach it in SqlServer Express 2008 with Advanced
Services.
The precise error message is: "An exception occurred while executing a
Transact-SQL statement or batch.
Could not find row in sysindexes for database ID 6, object ID 1,
index ID 1
1. Run DBCC CHECKTABLE on sysindexes. "
My friend, this query when run in SQL 2008:

select * from sys.messages
where text like 'Could not find row in sysindexes%'

returns no rows. Thus, that message does not come from an instance of
SQL 2008. Try running the query yourself.

And, an error message from SQL 2005 or SQL 2008 never tell you run DBCC
CHECKTABLE on sysindexes, because sysindexes is a view in these versions.
This message comes from an instance of SQL 2000.

Run "SELECT @@version" on the server where you try to attach the database
and see what you get.
--
Erland Sommarskog, SQL Server MVP, ***@sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
cowznofsky
2008-12-24 22:47:35 UTC
Permalink
There is nothing here from SqlServer 2000.  The database is from a
basic version of SQLServer Express 2005.
I am trying to attach it in SqlServer Express 2008 with Advanced
Services.
The precise error message is: "An exception occurred while executing a
Transact-SQL statement or batch.
 Could not find row in sysindexes for database ID 6, object ID 1,
 index ID 1
 1. Run DBCC CHECKTABLE on sysindexes. "
   select * from sys.messages
   where text like 'Could not find row in sysindexes%'
returns no rows. Thus, that message does not come from an instance of
SQL 2008. Try running the query yourself.
And, an error message from SQL 2005 or SQL 2008 never tell you run DBCC
CHECKTABLE on sysindexes, because sysindexes is a view in these versions.
This message comes from an instance of SQL 2000.
and see what you get.
--
SQL 2008:http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005:http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000:http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
I think I see the problem. It says SqlServer 2008 when I go into
Management Studio, but when I connect to what I thought was the db I
just installed, it shows version 8.0.760, which I assume to be an old
(2000?) one. I don't see any other local instance, and I don't see
anything in Services. So I evidently installed just the tools
without the database engine, and am connecting to an old instance.
Erland Sommarskog
2008-12-24 23:35:19 UTC
Permalink
Post by cowznofsky
I think I see the problem. It says SqlServer 2008 when I go into
Management Studio, but when I connect to what I thought was the db I
just installed, it shows version 8.0.760, which I assume to be an old
(2000?) one.
8.00.760 is indeed SQL 2000, more precisely SP3.

If you plan the instance to upgrade to SQL 2008, I think you will need
to upgrade the instance to SQL 2000 SP4 first, but I am not sure.

If you decide to install a new instance, you can still attach databases
from the SQL 2000 instance to SQL 2008.
--
Erland Sommarskog, SQL Server MVP, ***@sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
vipin92 Gupta
2012-01-31 09:01:23 UTC
Permalink
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 16, object ID 1,
index ID
1. Run DBCC CHECKTABLE on sysindexes.

Hi
Post by Erland Sommarskog
Basically the same message? Please post the exact error message. That
certainly could help you to get an accurate answer.
The error message above comes from SQL 2000, so my conclusion is that
you are trying to attach a database from SQL 2005/SQL 2008 on SQL 2000
and that is not going to work out.
--
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Post by Erland Sommarskog
select * from sys.messages
where text like 'Could not find row in sysindexes%'
returns no rows. Thus, that message does not come from an instance of
SQL 2008. Try running the query yourself.
And, an error message from SQL 2005 or SQL 2008 never tell you run DBCC
CHECKTABLE on sysindexes, because sysindexes is a view in these versions.
This message comes from an instance of SQL 2000.
and see what you get.
--
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Post by Erland Sommarskog
8.00.760 is indeed SQL 2000, more precisely SP3.
If you plan the instance to upgrade to SQL 2008, I think you will need
to upgrade the instance to SQL 2000 SP4 first, but I am not sure.
If you decide to install a new instance, you can still attach databases
from the SQL 2000 instance to SQL 2008.
--
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Post by cowznofsky
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 16, object ID 1,
index ID
1. Run DBCC CHECKTABLE on sysindexes.
(This is copied from a earlier post, but it's basically the same
message).
Any ideas?
I suppose I could just run that command on the source db, but it's in
production and working fine.
I then tried to restore a backup but got a message about too many
devices or files used (sorry I don't have the exact message here).
Post by Erland Sommarskog
e
echnol/sql/2005/downloads/books...
previousversions/books.mspx
There is nothing here from SqlServer 2000. The database is from a
basic version of SQLServer Express 2005.
I am trying to attach it in SqlServer Express 2008 with Advanced
Services.
The precise error message is: "An exception occurred while executing a
Transact-SQL statement or batch.
Could not find row in sysindexes for database ID 6, object ID 1,
index ID 1
1. Run DBCC CHECKTABLE on sysindexes. "
Post by cowznofsky
x
I think I see the problem. It says SqlServer 2008 when I go into
Management Studio, but when I connect to what I thought was the db I
just installed, it shows version 8.0.760, which I assume to be an old
(2000?) one. I don't see any other local instance, and I don't see
anything in Services. So I evidently installed just the tools
without the database engine, and am connecting to an old instance.
Erland Sommarskog
2012-01-31 14:48:42 UTC
Permalink
Post by cowznofsky
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 16, object ID 1,
index ID
1. Run DBCC CHECKTABLE on sysindexes.
That message typically occurs when you try to attach a database from
a higher version on SQL 2000.
--
Erland Sommarskog, SQL Server MVP, ***@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Loading...