Skip to content

Instantly share code, notes, and snippets.

@ghotz
Created May 8, 2024 10:05
Show Gist options
  • Save ghotz/b605e46c572eba3dc44dfb8beda72961 to your computer and use it in GitHub Desktop.
Save ghotz/b605e46c572eba3dc44dfb8beda72961 to your computer and use it in GitHub Desktop.
Evaluate and standardize page verify
SELECT
[name] AS database_name, page_verify_option_desc
, CASE
WHEN page_verify_option_desc = N'CHECKSUM'
THEN NULL
ELSE 'ALTER DATABASE [' + [name] + ']'
+ ' SET PAGE_VERIFY CHECKSUM;'
END AS alter_command
FROM sys.databases
WHERE [name] NOT IN ('master','model','msdb','tempdb')
AND state_desc = 'ONLINE'
ORDER BY [name]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment