SQL Server tutorial: Copy database tables to another database
To export the table structure and data from one SQL Server database to another existing or new database, use the Export Data… function in SQL Server Management Studio. This procedure will not copy any of the other database objects such as constraints, stored procedures, or users.
- In the Object Explorer, right click the name of the database. Select Tasks >Export Data…
- The SQL Server Import and Export Wizard will open. Click Next.
- Select a Data source type and server name. Enter the DBA’s login information, then select the source Database from the dropdown menu. Click Next.
- You can either write your own query or use the wizard to select which tables to copy. For this example, we’ll use the wizard. Select Copy data from one or more tables or views.
- Select specific tables to copy, or leave all selected to copy all tables.
- Select the Destination database. Click New… to create a database from scratch to export the data to.
- Check Run immediately, and click Finish to start the process.