Dismount-DbaDatabase
Chrissy LeMaire (@cl), netnerds.net
Dismount-DbaDatabase View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Detaches one or more databases from a SQL Server instance with built-in safety checks and validation. Description Safely detaches databases from SQL Server instances while performing comprehensive validation checks before detachment. This function automatically validates that databases aren’t system databases, replicated, or have active snapshots, preventing common detachment failures. When databases are part of mirroring or Availability Groups, the -Force parameter allows automatic cleanup by breaking mirrors and removing databases from AGs before detaching.
Read more
dbatools