Solved

Is there a way to programmatically change the recovery model on user DB's in MS SQL Server 2000?

Posted on 2006-06-09
3
439 Views
Last Modified: 2011-09-20
Here's my situation:  I have a developer who consistently forgets to reset the recovery model to Full after he works on his database (usually when he restores or if he changes models just for speed sake).  Unfortunately, the DB server he's working with houses about 40 other databases.  His is by far the largest, and the transaction log for him alone gets to the point where it chokes the server and brings down other DB's.

Ideally what I would like to do is set up a job that runs every night before the backup runs that changes the recovery model on any user databases (or even specific ones if I have to) via a stored procedure, etc.

Can anyone point me in the right direction?  It would save immense amounts of grief.

Thanks!
0
Comment
Question by:vferrari
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 250 total points
ID: 16870702
Alter database <dbname> set recovery <simple/full>
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 16870726
http://doc.ddart.net/mssql/sql70/sp_da-di_4.htm

to activate the full recovery mode:
exec sp_dboption 'trunc. log on chkpt.', 'FALSE'

to activate the simple recovery mode:
exec sp_dboption 'trunc. log on chkpt.', 'TRUE'
0
 

Author Comment

by:vferrari
ID: 16870788
Aneeshattingal,

That was EXACTLY what I was looking for.  Thanks!
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
I have a large data set and a SSIS package. How can I load this file in multi threading?
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

687 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question