none
How to dump all tables data from read only db to other db RRS feed

  • Question

  • Hello every one,

    How to dump all tables data from read only db to other db having same structure?.

    Is there any commands available in sql server or need to write console app in .net, please suggest me your ideas.

    Thanks,


    Siva Kumar Goru

    • Moved by Bob Beauchemin Friday, July 19, 2013 4:19 PM Moved to the forum for client-side .NET questions
    Friday, July 19, 2013 5:22 AM

Answers

  • Hello Siva,

    You can use three-part qualifier in the manner [Database].[Schema].[Object] to address several databases in one query. To copy data from a source to a destination database you can use such an INSERT command:

    INSERT INTO DestinationDB.dbo.Table1
        (Col1, Col2, ....)
    SELECT Col1, Col2, ...
    FROM SourceDB.dbo.Table1


    Olaf Helper

    Blog Xing

    Friday, July 19, 2013 6:47 AM

All replies

  • Hello Siva,

    You can use three-part qualifier in the manner [Database].[Schema].[Object] to address several databases in one query. To copy data from a source to a destination database you can use such an INSERT command:

    INSERT INTO DestinationDB.dbo.Table1
        (Col1, Col2, ....)
    SELECT Col1, Col2, ...
    FROM SourceDB.dbo.Table1


    Olaf Helper

    Blog Xing

    Friday, July 19, 2013 6:47 AM
  • hi Siva

     if you have source and destination database  in same instance use normal insert query with suggest by Olaf,but source and destination database different instance or server please go with options such as

      1.Linked Server

      2.Import and Export wizards.

      3.SSIS

      4.OPENROWSET.

    Please mark as ANSWER, if its helpful to you.

    Friday, July 19, 2013 6:53 AM