DF052: The READONLY, READWRITE, or TORN_PAGE_DETECTION option is used.

Last modified: May 28, 2025

The topic describes the DF052 T-SQL code analysis rule.

Category

DEPRECATED

Message

The READONLY, READWRITE, or TORN_PAGE_DETECTION option is used.

Description

READONLY, READWRITE, and TORN_PAGE_DETECTION options are deprecated and are no longer supported.

Additional information

  • The MODIFY FILEGROUP READONLY syntax was deprecated. Use the READ_ONLY syntax instead.
  • The MODIFY FILEGROUP READWRITE syntax was deprecated. Use the READ_WRITE syntax instead.
  • The syntax structure of TORN_PAGE_DETECTION ON | OFF will be removed in future versions of SQL Server. Use the PAGE_VERIFY option instead.

Noncompliant code example

ALTER DATABASE demodb MODIFY FILEGROUP [filegroup1] READONLY;
GO
ALTER DATABASE demodb MODIFY FILEGROUP [filegroup1] READWRITE;
GO
ALTER DATABASE demodb SET TORN_PAGE_DETECTION ON;
GO

Compliant solution

ALTER DATABASE demodb MODIFY FILEGROUP [filegroup1] READ_ONLY;
GO
ALTER DATABASE demodb MODIFY FILEGROUP [filegroup1] READ_WRITE;
GO
ALTER DATABASE demodb SET PAGE_VERIFY CHECKSUM;
GO