VBScript Class to Return Backup Information

  • Comments posted to this topic are about the content posted at http://www.sqlservercentral.com/columnists/bszabo/sqlbackups2.asp


    Bruce Szabo, MCSE+I, MCDBA, MCSD

  • Interesting. For me it would be easier to read if you broke up the source code and put your comments/discussion just above the pertinent code. Scrolling up/down isnt fun. Thats just me!

    On the code, you mention it will return the list of backups, but you're only getting the most recent?

    Andy

    http://www.sqlservercentral.com/columnists/awarren/

  • By list I guess I meant for each database. It would be easy enought to create something that would search for the backups of a given database. In my case I was writing something so the IT department could tell if a backup was successful or not.

    Bruce Szabo, MCSE+I, MCDBA, MCSD


    Bruce Szabo, MCSE+I, MCDBA, MCSD

  • Gotcha. Couple other notes. One is I hate to see code without error handling. Another is..I dont see where you are setting your connection to nothing, just closing it? Finally, why are you basically repeating your code in multiple lets? I'd rather see one 'GetHistory' method that calls a private routine.

    Interesting idea to encapsulate it. Looking forward to seeing your asp implementation.

    Andy

    http://www.sqlservercentral.com/columnists/awarren/

  • Thanks for the info Andy, some definite oversites on my part. I try to write some generic routines and put the articles out so they are generic enough that they may be useful. Then I go to work on my specific problem. I always end up with a better implmentation but I have found the code is sometimes light. I may have to change this methodolgy of article writing.

    The problem I am having with VBScript is that there is no "on error go to". It is killing me. I would like to do more error handling also but without the flexibilty the code get sloppy, quick.

    The last article I actually use more as a script to display to the users. I have the ASP implementation if you want me to send it to you, otherwise, I may have to write a 4th part of the article.

    Bruce Szabo, MCSE+I, MCDBA, MCSD


    Bruce Szabo, MCSE+I, MCDBA, MCSD

  • Hi

    Although fine, its all overally complex for a simple task. I can never understand why people use everything else (like SQL*DMO), vb-script, extended stored procs etc etc to do backups/report with either a maintenace plan or a simple t-sql script is more than enough. They are simple to read, quick to change (no recompiling etc) and doesnt require any special skills.

    Even so, the article does give another viewpoint and just shows that there are hundreds of ways to script up routines for your DB managemebt.

    Just my 2c worth.

    Cheers

    Ck


    Chris Kempster
    www.chriskempster.com
    Author of "SQL Server Backup, Recovery & Troubleshooting"
    Author of "SQL Server 2k for the Oracle DBA"

  • I wouldnt worry about changing your style too much - just try to put yourself in the readers shoes if you can. Dont know that I succeed at that myself! I think the combination of the article and the follow up discussion like this one serve the reader pretty well.

    Chris,

    I think one reason is it depends on your background. If you're a VB and/or object guy, DMO is a natural way to address a problem. If you do it as script you can still change on the fly. I use both techniques.

    Andy

    http://www.sqlservercentral.com/columnists/awarren/

  • The feedback to ther articles is amazing. In some cases just some ratings feedback is nice but it is a lot more humbling putting an article up and knowing people will get to comment on it.

    There was a "Sex in the City" episode recently about how we judge ourselves by our critics and their view of us. In most cases it is the negative critics. It was a nice episode for article writers to see.

    Bruce Szabo, MCSE+I, MCDBA, MCSD


    Bruce Szabo, MCSE+I, MCDBA, MCSD

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply