Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

Attach database with the same id Expand / Collapse
Posted Tuesday, November 20, 2012 1:55 AM
Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Thursday, October 20, 2016 4:28 AM
Points: 713, Visits: 2,789
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 ?
Post #1386733
Posted Tuesday, November 20, 2012 2:04 AM



Group: General Forum Members
Last Login: Thursday, September 1, 2016 2:56 AM
Points: 5,969, Visits: 6,067
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

Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
When a question, really isn't a question - Jeff Smith
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger

Post #1386738
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse