wondermorris avatar image
wondermorris asked

DB_ID from sys.databases

Hello SSC, I am receiving below error while running DBCC CHECKDB Check Database integrity on Local server connection Databases that have a compatibility level of 70 (SQL Server version 7.0) will be skipped. Databases: All databases Task start: 2016-07-03T09:00:13. Task end: 2016-07-03T12:56:52. Failed:(-1073548784) Executing the query "DBCC CHECKDB(N'1234567', NOINDEX) " failed with the following error: "Could not find an entry for table or index with partition ID 72057599569035264 in database 18. This error can occur if a stored procedure references a dropped table, or metadata is corrupted. Drop and re-create the stored procedure, or execute DBCC CHECKDB. DBCC results for '1234567'. Warning: NO_INDEX option of checkdb being used. Checks on non-system indexes will be skipped. It ends with below message: CHECKDB found 0 allocation errors and 0 consistency errors in database '1234567'. DBCC execution completed. If DBCC printed error messages, contact your system administrator.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly. When I look up for partition_id no rows returned. I went a head and tried to lookup name of 'database 18' using select * from sys.databases doesnt show any database with '18'. **May be sys.databases has not updated database_id for database '1234567** database id for '1234567' is 10. I have inherited this server so don't know if database 1234567 is created there or migrated. To me it's an issue of view sys.databases is not upgrading but not sure. How to fix if that's the case. How to resolve if that's not. SQL server version is 2012 Enterprise Edition Thanks in advance WonderMorris
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

What do you get if you run select db_name(18)
0 Likes 0 ·
select db_name (18) -- returns no column name (NULL) select db_name (14) -- returns database_name 1234567 select db_id ('1234567') as [database_id] -- returns database_id 14
0 Likes 0 ·
update please read 14 = 10 also dbcc dbinfo ('1234567') with tableresults returns dbi_dbid 10 dbi_dbcclastknowngood 2016-07-03
0 Likes 0 ·

0 Answers

· Write an Answer

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.