April 5, 2013 at 11:56 am
How to copy selected objects (tables(including data), views, store procedures) from one DB to another DB?
April 5, 2013 at 12:06 pm
DDL only, or DDL and also the data?
if it's just the DDL , i'd use the SSMS scripting wizard.
IN SSMS Object Explorer,
Right Click on a specific database.
Click Tasks>> Generate Scripts.
Follow the wizard steps.
For All Data, backup and restore is the #one choice, as it's prone to the fewest errors.
After that , the Import Export wizard is probably the easiest for selectively grabbing various tables. That's almost the same steps as above:
Right Click on a specific database.
Click Tasks>> Export Data.
Follow the wizard steps to select the target server and which objects..
Lowell
April 6, 2013 at 3:37 am
I'd suggest using the scripting wizard or right-clicking on individual objects as well. That generates the script you need and then you can run them on multiple different machines.
But, if you want to automate it, you might want to look at something like Red Gate SQL Compare[/url]. It'll do the job for you in a much more sophisticated fashion. It allows you to compare the databases and move the objects that are different between the two.
I do work for Red Gate.
"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
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply