Duplicating SQL DB Structure
I was wondering if anyone here knows how to duplicate an MS SQL Server Database, but without the data. I just need the structure. If I was to back up the current database and then do a restore on the back up and rename it, then I'd have a duplicated database. However, I don't want the data that's in it, so what's the best method. Should I use the method I just described and then just clear the tables? We're using SQL Server Enterprise Manager 8.0. There's an import/export function, but I think that will also import the tables, views, AND data into a new database I just created. Any help will be much appreciated.
SQL enterprise manager has the option to create sql scripts. You can use these to be able to recreate tables views etcetera in another database.
I believe it is in the right-click context menu at a database node.
Thanks Roelf, but what I need is actually a bit more complicated than what I first described (now that I have a full understanding of what our corporate controller wants).
What we have:
A database with all transactions that store info from about the middle of 2002 until current.
What we need:
A database that stores only info from 9/1/06 until current and a second database with only info from mid-2002 until 8/31/06.
We have about a million tables, relationships, etc. (slight exaggeration) to actually go through the tables and split them by a certain transaction date (and find out which dependent tables were affected by this), esp. transactions that were posted post-9/1/06, but affect the previous month. I called Microsoft to see if Great Plains has any capabilities to remove history, and let's just say that it's not very friendly and agreeable. Since the year isn't closed, we attempted (using MS's advice) to change the fiscal year end to 8/31/06, close out the year, and then remove the history for that year. Let's just say that good thing it was a test copy.
The accounting department is doing it their own way, so I've sort of backed out of this project. So I'll just leave it at that. Thanks for your help Roelf.
|All times are GMT +1. The time now is 02:47 AM.|
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.