SA0223 : The MODIFY FILEGROUP READONLY and READWRITE syntax is deprecated

The topic describes the SA0223 analysis rule.

Message

The MODIFY FILEGROUP READONLY and READWRITE syntax is deprecated

Description

The rule check T-SQL code for the deprecated feature syntax ALTER DATABASE MODIFY FILEGROUP READONLY or READWRITE.

The keyword READONLY and READWRITE keywords will be removed in a future version of Microsoft SQL Server.

How to fix

Do not use READONLY and READWRITE keywords in new development work. Modify existing code and use MODIFY FILEGROUP READ_ONLY or READ_WRITE syntax instead.

Scope

The rule has a Batch scope and is applied only on the SQL script.

Parameters

Rule has no parameters.

Remarks

The rule does not need Analysis Context or SQL Connection.

Effort To Fix
20 minutes per issue.
Categories

Deprecated Features, Bugs

Additional Information
Example Test SQL
SQL
1ALTER DATABASE TestDb1  MODIFY FILEGROUP Fg1 READONLY;
2
3ALTER DATABASE TestDb1  MODIFY FILEGROUP Fg2 READWRITE

Analysis Results
  Message Line Column
1 SA0223 : The MODIFY FILEGROUP READONLY and READWRITE syntax is deprecated. 1 45
2 SA0223 : The MODIFY FILEGROUP READONLY and READWRITE syntax is deprecated. 3 45
See Also

Other Resources