Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
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
Medium Priority
?
453 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 1000 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

610 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