Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1726
  • Last Modified:

SQL Server 2008: Could not find row in sysindexes for database ID 7, object ID 1, index ID 1. Run DBCC CHECKTABLE on sysindexes.

I am trying to attach a database but keep on getting the following error:
SQL Server 2008: Could not find row in sysindexes for database ID 7, object ID 1, index ID 1. Run DBCC CHECKTABLE on sysindexes.

I did run the DBCC CHECKTABLE on sysindexes and it returned with 104 rows with no errors.  I also ran DBCC CHECKDB --> but no errors.  

I am not migrating the database or upgrading from the previous verison of SQL server.  

Thanks
0
BSS2011
Asked:
BSS2011
  • 9
  • 7
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
please check the compatibility value of the database, is it 100 or is it lower?
0
 
Raja Jegan RSQL Server DBA & ArchitectCommented:
Try rebuilding the Clustered index on that particular table which might help out some times..
0
 
BSS2011Author Commented:
I ran the exec_sphelp and got 6 rows with dbnames, i see all my db's but not the one i need to attach.  Rebuilding index did not help.
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
Raja Jegan RSQL Server DBA & ArchitectCommented:
>> I ran the exec_sphelp and got 6 rows with dbnames,

Do you mean exec sp_help ..
If so, then it would return all objects present in your current database and if you are not connected to your database, then run this

USE ur_db_name
GO
exec sp_help

>> Rebuilding index did not help.

What error or response did you got while rebuilding your clustered index.
Ideally Clustered index would be your Primary key but it some cases it varies.
So kindly check it once and rebuild it accordingly.
0
 
BSS2011Author Commented:
Ran this:
USE ur_db_name
GO
exec sp_help

Could not locate entry in sysdatabases for my database.  

When rebuilding the index i must use the ALTER INDEX right?
0
 
Raja Jegan RSQL Server DBA & ArchitectCommented:
>> Could not locate entry in sysdatabases for my database.  

Missed mentioning that...
Replace ur_db_name with your database name and execute the above script.

>> When rebuilding the index i must use the ALTER INDEX right?

Yes, You need to use ALTER INDEX with REBUILD operation
or
Drop and recreate your index..
0
 
BSS2011Author Commented:
I did use my db name with sp_help.

If the db entry is not in sysindex table rebuilding index will not work.  Am I reindexing sysindex?
0
 
BSS2011Author Commented:
Tried re-indexing but could not locate entry in sysdatabases.
0
 
Raja Jegan RSQL Server DBA & ArchitectCommented:
>> I also ran DBCC CHECKDB --> but no errors.  

Can you try running this:

DBCC CHECKDB ur_db_name WITH ALL_ERRORMSGS;
0
 
BSS2011Author Commented:
Same error:  could not locate entry in sysdatabases.
0
 
Raja Jegan RSQL Server DBA & ArchitectCommented:
Are you sure your database is available in the instance you are testing with..
And is your database accessible.

Kindly run this query and paste its output here:

SELECT * FROM sys.databases
WHERE name LIKE '%ur_db_name%'

PS: Do replace ur_db_name with your db name.
0
 
BSS2011Author Commented:
I ran the query and got no results.  
0
 
BSS2011Author Commented:
When i ran the following this time:

USE ur_db_name
GO
exec sp_help

I got the error the administrator is not able to access the db.  Different error this time and I can see the db now in the object explorer but cannot access it.
0
 
BSS2011Author Commented:
I did a query on sys.databases again but returned with no rows.
0
 
Raja Jegan RSQL Server DBA & ArchitectCommented:
>> I got the error the administrator is not able to access the db.

Then it means that your database is not accessible...
If you have a database backup available, then its recommended to restore your backup and have this error fixed out.
0
 
BSS2011Author Commented:
Ended up restoring the backup.  
0
 
Raja Jegan RSQL Server DBA & ArchitectCommented:
>> Ended up restoring the backup

Isn't the same which I have suggested you earlier in my comment http:#a34893569.
It would have been fair to accept my comment as solution..
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 9
  • 7
Tackle projects and never again get stuck behind a technical roadblock.
Join Now