Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Copy certain tables,stored procedures and views from one Database to another Expand / Collapse
Author
Message
Posted Tuesday, April 30, 2013 11:05 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, November 12, 2014 11:16 AM
Points: 38, Visits: 117
Hello,

I am new sorry, hope i can explain this right, I have an old database called database1, which now we have a new database called database2 (these are not the real names lol), database1 and database2 have the same table names, stored procedures etc, but database1 had foreign keys etc, what I want to know is there a way to copy over only certain database tables from one database to another, not copying the entire database but only the tables needed and restore them onto database2? is there a way for doing the same for certain stored procedures and/or views and not all only certain ones?

I have SSIS but so far i can only see for data purposes...

Thanks in advance
Post #1448150
Posted Tuesday, April 30, 2013 11:49 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Tuesday, October 21, 2014 5:02 AM
Points: 68, Visits: 423
Use the Transfer SQL Server Objects Task in SSIS. Pretty straight forward.

[url=http://msdn.microsoft.com/en-us/library/ms142159.aspx][/url]
Post #1448172
Posted Tuesday, April 30, 2013 11:54 AM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Friday, November 7, 2014 2:00 PM
Points: 979, Visits: 3,364
It would be much more simple to script the objects in SSMS and execute the script against the database that you want. Any and all databases that you want. When generating the script, you have the options to pick only the database objects that you need or want. This will script the constraints and indices in order of creation.

Andrew SQLDBA
Post #1448175
Posted Tuesday, April 30, 2013 12:00 PM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Sunday, September 29, 2013 1:24 AM
Points: 429, Visits: 1,721
The easiest method is GENERATE SCRIPTS:









  Post Attachments 
GenScriptStep1.PNG (143 views, 29.30 KB)
GenScriptStep2.PNG (140 views, 23.01 KB)
GenScriptStep3.PNG (138 views, 25.87 KB)
GenScriptStep4.PNG (139 views, 44.12 KB)
Post #1448178
Posted Thursday, August 8, 2013 12:16 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, September 9, 2013 10:20 PM
Points: 1, Visits: 52
Lol.. That was like spoon feeding...
Post #1482510
Posted Monday, August 19, 2013 4:18 PM


Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Friday, October 24, 2014 12:38 PM
Points: 522, Visits: 240
SQL Server 2008 R2 has additional option to Generate script with data. Helps a lot in cases :)
Post #1486053
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse