Unix Technical Forum

Setting recover model with TSQL

This is a discussion on Setting recover model with TSQL within the SQL Server forums, part of the Microsoft SQL Server category; --> I have a TSQL script that restores a production database to my local development machine. Every time I do ...


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, 01:10 PM
rsyring@gmail.com
 
Posts: n/a
Default Setting recover model with TSQL

I have a TSQL script that restores a production database to my local
development machine. Every time I do a restore, I have to go into
Enterprise Manager and set the recover model to simple to prevent
Windows XP Backup from having shadow copy problems (that is a rant in
and of itself). I would like to just add a statement at the bottom of
the script to do this, but have yet to find the proper commands
documented. It seems that the instructions that come with the server
only mention enterprise manager.

Thanks in advance for any help.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 03-01-2008, 01:10 PM
Erland Sommarskog
 
Posts: n/a
Default Re: Setting recover model with TSQL

rsyring@gmail.com (rsyring@gmail.com) writes:
> I have a TSQL script that restores a production database to my local
> development machine. Every time I do a restore, I have to go into
> Enterprise Manager and set the recover model to simple to prevent
> Windows XP Backup from having shadow copy problems (that is a rant in
> and of itself). I would like to just add a statement at the bottom of
> the script to do this, but have yet to find the proper commands
> documented. It seems that the instructions that come with the server
> only mention enterprise manager.


ALTER DATABASE db SET RECOVERY SIMPLE


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 03-01-2008, 01:10 PM
rsyring@gmail.com
 
Posts: n/a
Default Re: Setting recover model with TSQL



On Jan 27, 3:53 pm, Erland Sommarskog <esq...@sommarskog.se> wrote:
>ALTER DATABASE db SET RECOVERY SIMPLE
>
> --
> Erland Sommarskog, SQL Server MVP, esq...@sommarskog.se
>
> Books Online for SQL Server 2005 athttp://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books...
> Books Online for SQL Server 2000 athttp://www.microsoft.com/sql/prodinfo/previousversions/books.mspx


Many Thanks!

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 02:33 PM.


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