Friday, March 30, 2012

Recovery Model What Database/table stores info

What database/table stores information on the recovery models used for all
database on an SQL server? I want to change all to FUll. ThanksThis will create a script. Run it in query analyzer, then copy the lower
pane, paste to the top, and run again:
SELECT 'ALTER DATABASE '+name+' SET RECOVERY FULL'
FROM master..sysdatabases
WHERE name NOT IN ('master','tempdb','msdb','model')
"Lontae Jones" <LontaeJones@.discussions.microsoft.com> wrote in message
news:1B6EC27B-F874-4051-90DE-C21338E393EE@.microsoft.com...
> What database/table stores information on the recovery models used for all
> database on an SQL server? I want to change all to FUll. Thanks|||Use "alter database" instead. Copy the result of the following "select"
statement annd execute it in QA.
select
'alter database ' + quotename(catalog_name) + 'set recovery full'
from
information_schema.schemata
where
catalog_name not in ('master', 'model', 'tempdb', 'msdb', 'pubs',
'northwind')
and databasepropertyex(catalog_name, 'Recovery') != 'FULL'
go
AMB
"Lontae Jones" wrote:

> What database/table stores information on the recovery models used for all
> database on an SQL server? I want to change all to FUll. Thanks|||> from
> information_schema.schemata
FWIW, this no longer works the same in SQL Server 2005. I think it's the
only Information_schema view that breaks backward compatibility, but in
truth, it currently doesn't work the way it should anyway. SoI have been
shying away from recommending the schemata view specifically, because its
useful lifetime is rather short.
A|||Do we have a schema database diagram poster for 2005 yet?
"Aaron Bertrand [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:%23Kj03b9rFHA.3340@.TK2MSFTNGP15.phx.gbl...
> FWIW, this no longer works the same in SQL Server 2005. I think it's the
> only Information_schema view that breaks backward compatibility, but in
> truth, it currently doesn't work the way it should anyway. SoI have been
> shying away from recommending the schemata view specifically, because its
> useful lifetime is rather short.
> A
>
>|||Gosh no
"JT" <someone@.microsoft.com> wrote in message
news:%23zYU1e9rFHA.904@.tk2msftngp13.phx.gbl...
> Do we have a schema database diagram poster for 2005 yet?|||Aaron,
Thanks for sharing that.
AMB
"Aaron Bertrand [SQL Server MVP]" wrote:

> FWIW, this no longer works the same in SQL Server 2005. I think it's the
> only Information_schema view that breaks backward compatibility, but in
> truth, it currently doesn't work the way it should anyway. SoI have been
> shying away from recommending the schemata view specifically, because its
> useful lifetime is rather short.
> A
>
>sql

No comments:

Post a Comment