0

Sql server attach prerequisite states that a db must be detached before trying to attach it to another instance (https://learn.microsoft.com/en-us/sql/relational-databases/databases/attach-a-database?view=sql-server-ver15#Prerequisites)

However this migration link (https://learn.microsoft.com/en-us/sql/database-engine/install-windows/choose-a-database-engine-upgrade-method?view=sql-server-ver15#migrate-to-a-new-installation) recommends an attach without any mention about detach. Example:

enter image description here

What is the implication at attempting an attach without detach?

variable
  • 3,590
  • 4
  • 37
  • 100

1 Answers1

2

However this migration link recommends an attach without any mention about detach.

You are not reading it correctly, the attach here means any database for which mdf file is present. A classic case here is stopping the database and moving the mdf files and then attaching it, this actually avoids detach. But I seldom use this method

  1. It changes database owner
  2. Many times specially with SQL Server 2005/2008 i have faced database corruption while stopping DB, moving mdf files and attaching.

Similar thread

Nothing beats good backup and restore.

Shanky
  • 19,148
  • 4
  • 37
  • 58