locked
copy views from one db to another in the same server RRS feed

  • Question

  • I want to copy a few views across two databases within the same server in sql 2005. Can you please provide some help? Thanks

    Thursday, November 26, 2009 10:10 PM

Answers

  • You may use DATABASE PUBLISHING WIZARD to copy only the schema of all the views that you are looking to transport and that will generate a SQL script file and this file can be executed at the destination DB.

    Thanks, Leks
    Thursday, November 26, 2009 10:14 PM
    Answerer
  • You can also right click your database > task > generate script > select the views and generate the script to a file and run it in the appropriate database. Another option is to use select the database in object explorer > task > export database and give the source db and destination db name. Select the views to export and complete the wizard steps.

    - Deepak
    Deepak | Mark the answers if it helps to solve your problem |
    Friday, November 27, 2009 10:39 AM

All replies

  • You may use DATABASE PUBLISHING WIZARD to copy only the schema of all the views that you are looking to transport and that will generate a SQL script file and this file can be executed at the destination DB.

    Thanks, Leks
    Thursday, November 26, 2009 10:14 PM
    Answerer
  • You can also right click your database > task > generate script > select the views and generate the script to a file and run it in the appropriate database. Another option is to use select the database in object explorer > task > export database and give the source db and destination db name. Select the views to export and complete the wizard steps.

    - Deepak
    Deepak | Mark the answers if it helps to solve your problem |
    Friday, November 27, 2009 10:39 AM