Copy certain tables,stored procedures and views from one Database to another

  • 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

  • Use the Transfer SQL Server Objects Task in SSIS. Pretty straight forward.

  • 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

  • The easiest method is GENERATE SCRIPTS:

  • Lol.. That was like spoon feeding... 🙂

  • SQL Server 2008 R2 has additional option to Generate script with data. Helps a lot in cases 🙂

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply