Attach database with the same id

  • i detached the database with the dbis as 6 , after i attached the database the db is has changed. How can we attach the database with the same dbid ?

  • You dont, SQL will always assign the lowest free number from sys.databases to a newly created / attached database, so either another database was created and got DBID 6 so when you attached you got the max+1 DBID or DBID 5 was free so when you attached the database so SQL assigned it DBID 5

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply