dbTalk Databases Forums  

Modifying SQL Server 2000 Maintenance Plans through Scripting

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss Modifying SQL Server 2000 Maintenance Plans through Scripting in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
pk
 
Posts: n/a

Default Modifying SQL Server 2000 Maintenance Plans through Scripting - 04-24-2007 , 11:34 AM






I have a problem that I would like to resolve through scripting, but
I'm not sure how to go about it (or if it's even possible.)

We're trying to work around a bug (
http://support.microsoft.com/default...&Product=sql2k
) that requires us to split up our maintenance plan into two parts.
In the first, we backup "All User Databases". This runs fine. The
second maintenance plan backs up the transaction logs and then is
SUPPOSED to delete the ones older than 4 days. If you read that
knowledge base article I referenced above, you'll see that this
doesn't happen. Our company creates a lot of databases every day and
it's not feasible for me to check every one by hand every night before
I head home to make sure that they get backed up correctly.

I would like to have a script that checks for all user databases that
are set to FULL Recovery Model

SELECT name, DATABASEPROPERTYEX(name, 'Recovery') as RecoveryModel
FROM master.dbo.sysdatabases
WHERE DATABASEPROPERTYEX(name, 'Recovery') = 'FULL'
ORDER BY 2

and re-enters them all into the second maintenance plan (obviously not
as duplicates) right before it runs. I don't think my scripting
knowledge is up to par, so I'm really looking for someone to help me
out. You can bet I'll study the solution after I get it though.

Thanks in advance.

-pk


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



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.