Skip to content

Instantly share code, notes, and snippets.

@eriksimonic
Created May 4, 2015 07:41
Show Gist options
  • Save eriksimonic/3591c933cbd212ad6bc4 to your computer and use it in GitHub Desktop.
Save eriksimonic/3591c933cbd212ad6bc4 to your computer and use it in GitHub Desktop.
SQL Create queries for all databases..
DECLARE @sql NVARCHAR(MAX) = N'';
SELECT @sql += N'ALTER DATABASE '+QUOTENAME(name)+N' SET RECOVERY SIMPLE WITH NO_WAIT; GO;'
from sys.databases
where database_id > 4;
PRINT @sql;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment