Home Forums SQL Server 2008 T-SQL (SS2K8) Use a SELECT to ALTER properties of all databases of certain type... RE: Use a SELECT to ALTER properties of all databases of certain type...

  • Keeping in mind that you'll be running it from a script yourself and not exposing it to the internet, how about something like this?

    SELECT 'ALTER DATABASE ' + name + ' SET RECOVERY SIMPLE WITH NO_WAIT;'

    FROM sys.databases

    WHERE recovery_model_desc = 'SIMPLE'

    AND name NOT IN ('master','model','msdb','tempdb')

    ORDER BY name;