Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Datalinks and inserting between DBs

  • 06-02-2013 07:26PM
    #1
    Registered Users, Registered Users 2 Posts: 83 ✭✭


    Hi, I've already set up a database link between my two databases.

    I am now trying to insert 1 record from a table on database a into the same named table on database b. Records already exist on database b though so I only want to insert one new record and not delete any existing ones.

    I'm struggling to get it right though. Can someone review what I've suggested below?

    insert into destinationdb tablename
    select * from sourcedb tablename
    where customernumber = 'ABC';


Comments

  • Registered Users, Registered Users 2 Posts: 419 ✭✭Mort5000


    Are you getting an error?

    It should be something on the lines of:
    insert into schemaname.tablename@databaselinkname select * from tablename
    


Advertisement