|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Recovery modelHello,
How can I find the type of recovery set to a database from the system tables? Thanks in advance try this..
select DATABASEPROPERTYEX('<dbname>','recovery') Hope this helps. I was wondering about the system table name where this value is stored.
Thanks for your response though ... Show quote "Omnibuzz" wrote: > try this.. > select DATABASEPROPERTYEX('<dbname>','recovery') > > Hope this helps. > -- > -Omnibuzz (The SQL GC) > > http://omnibuzz-sql.blogspot.com/ > > What version are you running?
In SQL 2005 you can run this: select name, recovery_model_desc from sys.databases -- Show quoteHTH Kalen Delaney, SQL Server MVP "David" <Da***@discussions.microsoft.com> wrote in message news:458A1E14-B894-49F1-B276-E16B6C2AA330@microsoft.com... >I was wondering about the system table name where this value is stored. > Thanks for your response though ... > > "Omnibuzz" wrote: > >> try this.. >> select DATABASEPROPERTYEX('<dbname>','recovery') >> >> Hope this helps. >> -- >> -Omnibuzz (The SQL GC) >> >> http://omnibuzz-sql.blogspot.com/ >> >> Thanks for your response. I am using SQL Server 2000
Show quote "Kalen Delaney" wrote: > What version are you running? > In SQL 2005 you can run this: > > select name, recovery_model_desc from sys.databases > > -- > HTH > Kalen Delaney, SQL Server MVP > > > "David" <Da***@discussions.microsoft.com> wrote in message > news:458A1E14-B894-49F1-B276-E16B6C2AA330@microsoft.com... > >I was wondering about the system table name where this value is stored. > > Thanks for your response though ... > > > > "Omnibuzz" wrote: > > > >> try this.. > >> select DATABASEPROPERTYEX('<dbname>','recovery') > >> > >> Hope this helps. > >> -- > >> -Omnibuzz (The SQL GC) > >> > >> http://omnibuzz-sql.blogspot.com/ > >> > >> > > > In SQL 2000, the recovery model is encoded in the bitstring in
sysdatabases.status. If you know how to do bit arithmetic, you can determine which databases have the 4 bit on, and those are the databases in SIMPLE mode. A database with the 4 bit off and the 8 bit on is in BULK_LOGGED. A database with neither bit on is in FULL. It's much simpler to use the function Omnibuzz supplied: select name, databasepropertyex(name, 'recovery') from sysdatabases -- Show quoteHTH Kalen Delaney, SQL Server MVP "David" <Da***@discussions.microsoft.com> wrote in message news:1CCFF311-2ADD-4235-B591-C6068D8C7A87@microsoft.com... > Thanks for your response. I am using SQL Server 2000 > > "Kalen Delaney" wrote: > >> What version are you running? >> In SQL 2005 you can run this: >> >> select name, recovery_model_desc from sys.databases >> >> -- >> HTH >> Kalen Delaney, SQL Server MVP >> >> >> "David" <Da***@discussions.microsoft.com> wrote in message >> news:458A1E14-B894-49F1-B276-E16B6C2AA330@microsoft.com... >> >I was wondering about the system table name where this value is stored. >> > Thanks for your response though ... >> > >> > "Omnibuzz" wrote: >> > >> >> try this.. >> >> select DATABASEPROPERTYEX('<dbname>','recovery') >> >> >> >> Hope this helps. >> >> -- >> >> -Omnibuzz (The SQL GC) >> >> >> >> http://omnibuzz-sql.blogspot.com/ >> >> >> >> >> >> >> |
|||||||||||||||||||||||