Home Forums Programming Powershell SQL Server Detach database RE: SQL Server Detach database
Tony Sweet
Ten Centuries
Points: 1049
More actions
April 22, 2014 at 9:52 am
#1707823
Looks like you are missing a parameter in the DetachDatabase syntax.
See this: http://technet.microsoft.com/en-us/library/microsoft.sqlserver.management.smo.server.detachdatabase.aspx
You need to add a Boolean for the update statistics parameter. Assuming you don't want to do this, it would look like
$server.DetachDatabase("databasename", FALSE)
- Tony Sweet