01 August 2005

Technology: SQLDMO

If you're not a geek, you might want to skip this post.

I've started working on this project where we have a 20+ gig database that contains data from several regions. Each region wants their data but can't be given data from the other regions...so what do we do?

Well, I've discovered the power of the SQLDMO.dll that the Axis of Evil has produced. (My masters insist I serve the dark side.) Anyway...with this nifty little tool, I can create a script to backup the original database, create a dummy database somewhere else, restore the backup to the dummy, delete all the intellectual property our vendor doesn't allow us to give our offices...like stored procedures and views (don't ask me why a view is intellectual property any more than data is), and all user accounts except the primary access admin. Once I've got a dummy database, I can then go through and delete the regional data for offices not receiving a dump.

The beauty of this is that other sysadmins can edit the variables in the main function of the script that tell it where the original database is and where to create the dummy and the whole thing runs in less time that it took to manually do a backup and restore.

No comments: