Sample script that deletes a SQL Server database.

Visual Basic
Edit|Remove
strDBServerName = "."
strDBToDelete       = "ScriptingGuysTestDB"

Set objSQLServer = CreateObject("SQLDMO.SQLServer")
objSQLServer.LoginSecure = True
objSQLServer.Connect strDBServerName

objSQLServer.KillDatabase strDBToDelete