Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 460
  • Last Modified:

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

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
vferrari
Asked:
vferrari
1 Solution
 
Aneesh RetnakaranDatabase AdministratorCommented:
Alter database <dbname> set recovery <simple/full>
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
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
 
vferrariAuthor Commented:
Aneeshattingal,

That was EXACTLY what I was looking for.  Thanks!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now