For those on Azure, follow these modified instructions from Virus:
- Open SSMS.
- Right-click the Database you wish to copy data from.
- Select Generate Scripts >> Select Specific Database Objects >> Choose the tables/object you wish to transfer.
strong text
- In the "Save to file" pane, click Advanced
- Set "Types of data to script" to Schema and data
- Set "Script DROP and CREATE" to Script DROP and CREATE
- Under "Table/View Options" set relevant items to TRUE. Though I recommend setting all to TRUE just in case. You can always modify the script after it generates.
- Set filepath >> Next >> Next
- Open newly created SQL file. Remove "Use" from top of file.
- Open new query window on destination database, paste script contents (without using) and execute.