Restoring an database schema only

  • Hi

    I have a requirement to restore one of our production databases minus the data.

    I have on my personal laptop sql2012 server installed and I have used the 'Extract Data-tier Application to create a file which just contains the schema of one of my demo databases. Once you complete this simple process (basically just choose where to save the file) it is a simple matter of right clicking the databases node, and selecting 'Import Data-Tier Application' and hey presto I have a restored database with schema, sp's, triggers etc minus any data. A very useful feature.

    I can see in sql2008r2 we can create the dacpac file via the same process as 2012 but when I come to restore the database there is no option for 'Import Data-tier Application' when I right click on the databases node. Is it somewhere else ? If not - is there another way of restoring this file ?

  • Guys - I think i have worked this out !

    The option to 'Deploy Data-tier Application' is available when you right click the instance and not the database node.

    This should do the trick and give me an empty database with the schema restored.

    Thanks.

  • Yep. That'll work. Or you can export the schema to a T-SQL script and then import that.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Yeah I also exported to a script and that did the trick also.

    Thanks Grant.

Viewing 4 posts - 1 through 4 (of 4 total)

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