# SQL Server Management Studio #
This is your best tool for performing this task. You can generate a script that will build whichever tables you wish from a database as well as insert the data in those tables (as far as I know you have to export all of the data in the selected tables however).
To do this follow these steps:
1. ### Right-click on your database and select Tasks > Generate Scripts ###
2. ### In the Generate and Publish Scripts wizard, select the "Select specific database objects" option ###
3. ### Expand the "Tables" tree and select all of the tables you wish to export the scheme and data for, then click Next ###
4. ### In the next screen choose how you wish to save the script (the Output Type must remain set as "Save scripts to a specific location"), then click the Advanced button in the top right corner ###
5. ### In the newly opened window, under the General section is a setting called "Types of data to script", set this to "Scheme and data" and click OK ###
6. ### Click Next, review the export summary and click Next again. This will generate the script to your selected destination. ###
To restore your database, simply create a new database and change the first line of your generated script to `USE [Your.New.Database.Name]`, then execute. Your new database will now have all of the tables and data you selected from the original database.