Results 1 to 2 of 2
  1. #1
    Join Date
    May 2004
    Location
    bangalore
    Posts
    270

    Exclamation Unanswered: Inserting in different database

    Hi Folks,
    I have two database. database A, and database B. now I want to insert some recordrs from the table of database A to some table of database B, using "insert" command. Please help me out in this regard.

    Please help me.

    Thanx.

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    I'd use something like:
    Code:
    USE databaseA
    GO
    
    INSERT INTO databaseB.dbo.oneTable (col1, col2)
       SELECT col3, col4
          FROM databaseC.dbo.anotherTable
    This allows you to be in databaseA, get data from databaseC, and put that data into databaseB!

    -PatP

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •