Link to home
Start Free TrialLog in
Avatar of vferrari
vferrari

asked on

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!
ASKER CERTIFIED SOLUTION
Avatar of Aneesh
Aneesh
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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'
Avatar of vferrari
vferrari

ASKER

Aneeshattingal,

That was EXACTLY what I was looking for.  Thanks!