Unix Technical Forum

Query for Backup Model

This is a discussion on Query for Backup Model within the SQL Server forums, part of the Microsoft SQL Server category; --> I'm trying to write some T-SQL code for adding some fills and thrills to backups but ran into a ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > SQL Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-01-2008, 02:42 PM
Utahduck@hotmail.com
 
Posts: n/a
Default Query for Backup Model

I'm trying to write some T-SQL code for adding some fills and thrills
to backups but ran into a snag. Is there a way to query what backup
model a database is using? I can see it if I right click a database,
go to properties, select the options tab, and then can see the current
model (full, bulk-logged, and simple) but I would need to hard code
each database. In the spirit of automation, I'd rather query for the
type and then work around that instead. But I've been all over the
master database and can't seem to find any field that will indicate
the backup type.

Any guru's out there that can point me in the right direction?

Thanks,
Utah

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 03-01-2008, 02:42 PM
KenJ
 
Posts: n/a
Default Re: Query for Backup Model

Hi Utah,

Try DATABASEPROPERTYEX in Books Online: http://msdn2.microsoft.com/en-us/library/ms186823.aspx

You'll want the Recovery property.

Thanks,

KenJ



On Mar 15, 5:45 pm, Utahd...@hotmail.com wrote:
> I'm trying to write some T-SQL code for adding some fills and thrills
> to backups but ran into a snag. Is there a way to query what backup
> model a database is using? I can see it if I right click a database,
> go to properties, select the options tab, and then can see the current
> model (full, bulk-logged, and simple) but I would need to hard code
> each database. In the spirit of automation, I'd rather query for the
> type and then work around that instead. But I've been all over the
> master database and can't seem to find any field that will indicate
> the backup type.
>
> Any guru's out there that can point me in the right direction?
>
> Thanks,
> Utah



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 03-01-2008, 02:42 PM
Utahduck@hotmail.com
 
Posts: n/a
Default Re: Query for Backup Model

On Mar 15, 7:43 pm, "KenJ" <kenjohn...@hotmail.com> wrote:
> Hi Utah,
>
> Try DATABASEPROPERTYEX in Books Online:http://msdn2.microsoft.com/en-us/library/ms186823.aspx
>
> You'll want the Recovery property.
>
> Thanks,
>
> KenJ
>
> On Mar 15, 5:45 pm, Utahd...@hotmail.com wrote:
>
>
>
> > I'm trying to write some T-SQL code for adding some fills and thrills
> > to backups but ran into a snag. Is there a way to query what backup
> > model a database is using? I can see it if I right click a database,
> > go to properties, select the options tab, and then can see the current
> > model (full, bulk-logged, and simple) but I would need to hard code
> > each database. In the spirit of automation, I'd rather query for the
> > type and then work around that instead. But I've been all over the
> > master database and can't seem to find any field that will indicate
> > the backup type.

>
> > Any guru's out there that can point me in the right direction?

>
> > Thanks,
> > Utah- Hide quoted text -

>
> - Show quoted text -


That could not have been more perfect. THANK YOU!

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 07:18 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com