RecoveryModel Property

未來的 Microsoft SQL Server 發行版本將不再提供此功能。請避免在新的開發工作中使用此功能,並計劃修改目前使用此功能的應用程式。

The RecoveryModel property specifies the recovery model for a database.

語法

object
.RecoveryModel [= value]

Parts

  • object
    An expression that evaluates to an object in the Applies To list.
  • value
    An integer that indicates which recovery model to use as specified in Settings.

Settings

Constant Value Description

SQLDMORECOVERY_BulkLogged

1

Uses the Bulk-Logged Recovery model.

SQLDMORECOVERY_Full

2

Uses the Full Recovery model.

SQLDMORECOVERY_Simple

0

Default. It uses the Simple Recovery model.

SQLDMORECOVERY_Unknown

3

The recovery model is unknown.

Data Type

Long, enumerated

Modifiable

Read/write

Prototype (C/C++)

HRESULT GetRecoveryModel(SQLDMO_RECOVERY_TYPE);
HRESULT SetRecoveryModel(SQLDMO_RECOVERY_TYPE);

備註

Microsoft SQL Server provides the Simple, Bulk-Logged, and Full Recovery models to simplify recovery planning, to simplify backup and recovery procedures, and to clarify tradeoffs between system operational requirements. An application can use the RecoveryModel property to specify which recovery model to use.

ms140654.note(zh-tw,SQL.90).gif附註:
If an application calls RecoveryModel on an instance of SQL Server version 7.0, the constant, SQLDMO_E_SQL80ONLY, and the message "This property or method requires Microsoft SQL Server 2000 or later" are returned.

Applies To:

DBOption2 Object

 

請參閱

其他資源

ALTER DATABASE (Transact-SQL)

說明及資訊

取得 SQL Server 2005 協助