Home Forums SQL Server 2008 T-SQL (SS2K8) OPENQERY Syntax to Insert into SQL Server Table from Oracle Linked Server. RE: OPENQERY Syntax to Insert into SQL Server Table from Oracle Linked Server.

  • Lynn Pettis (8/28/2014)


    ChrisM@Work (8/28/2014)


    Welsh Corgi (8/28/2014)


    ChrisM@Work (8/28/2014)


    Welsh Corgi (8/28/2014)


    The example that I provided is not actually what I need. I want the Insert columns to be all from the Oracle Table.

    Any ideas would be greatly appreciated.

    Remove the join and the WHERE clause.

    I do not get the reason for SELECT Distinct?

    There may be duplicates across the columns selected from the remote. DISTINCT will eliminate those duplicates. Unless the count of such dupes is of interest to you, it makes sense to do this. In any case, it would be more network-efficient to count any dupes at source.

    Or, looking at the sample query provided by Welsh Corgi, they only wanted distinct rows across c1, c2, c3.

    Yes, that too.

    “Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden