Udostępnij za pośrednictwem


KillDatabase Method

This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature.

The KillDatabase method drops a database from the referenced Microsoft SQL Server installation, regardless of the status or availability of the database.

Syntax

object
.KillDatabase(
Database
)

Parts

  • object
    Expression that evaluates to an object in the Applies To list.
  • Database
    String specifying an existing database by name.

Prototype (C/C++)

HRESULT KillDatabase(
SQLDMO_LPCSTR szDatabase);

Remarks

The Remove method of the Database object and Databases collection drops a referenced database. A database drop can fail if the database is offline. When the Remove method of the Database object or Databases collection fails, use the KillDatabase method to force a drop of the database.

Applies To:

SQLServer Object