db_recovery_status

Description

(Cluster environments only) Returns the recovery status of the specified database. Returns the recovery status of the current database if you do not include a value for database_ID or database_name.

Syntax

db_recovery_status([database_ID | database_name])

Parameters

database_ID

is the ID of the database whose recovery status you are requesting.

database_name

is the name of the database whose recovery status you are requesting.

Examples

Example 1

Returns the recovery status of the current database:

select db_recovery_status()

Example 2

Returns the recovery status of the database with named test:

select db_recovery_status("test")

Example 3

Returns the recovery status of a database with a database id of 8:

select db_recovery_status(8)

Usage

A return value of 0 indicates the database is not in node-failover recovery. A return value of 1 indicates the database is in node-failover recovery.

Standards

ANSI SQL – Compliance level: Transact-SQL extension.

Permissions

Any user can execute db_recovery_status.