Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Senior Coder TheShaner's Avatar
    Join Date
    Sep 2005
    Location
    Orlando, FL
    Posts
    1,126
    Thanks
    2
    Thanked 40 Times in 40 Posts

    Duplicating SQL DB Structure

    Hey all,

    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.

    Thanks,

    Shane

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Zwolle, The Netherlands
    Posts
    1,120
    Thanks
    2
    Thanked 31 Times in 31 Posts
    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.
    I am the luckiest man in the world

  • #3
    Senior Coder TheShaner's Avatar
    Join Date
    Sep 2005
    Location
    Orlando, FL
    Posts
    1,126
    Thanks
    2
    Thanked 40 Times in 40 Posts
    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.

    -Shane


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •