Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8213451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T11:07:21+00:00 2026-06-07T11:07:21+00:00

I have two datasets on two seperate servers. They both pull one column of

  • 0

I have two datasets on two seperate servers. They both pull one column of information each.

I would like to build a report showing the values of the rows that only appear in one of the datasets.

From what I have read, it seems I would like to do this on the SQL side, not the reporting side; I am not sure how to do that.

If someone could shed some light on how that is possible, I would really appreciate it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T11:07:23+00:00Added an answer on June 7, 2026 at 11:07 am

    You can use the NOT EXISTS clause to get the differences between the two tables.

    SELECT
        Column
    FROM
        DatabaseName.SchemaName.Table1
    WHERE
        NOT EXISTS
        (
            SELECT
                Column
            FROM
                LinkedServerName.DatabaseName.SchemaName.Table2
            WHERE
                Table1.Column = Table2.Column --looks at equalities, and doesn't
                                              --include them because of the
                                              --NOT EXISTS clause
        )
    

    This will show the rows in Table1 that don’t appear in Table2. You can reverse the table names to find the rows in Table2 that don’t appear in Table1.

    Edit: Made an edit to show what the case would be in the event of linked servers. Also, if you wanted to see all of the rows that are not shared in both tables at the same time, you can try something as in the below.

    SELECT
        Column, 'Table1' TableName
    FROM
        DatabaseName.SchemaName.Table1
    WHERE
        NOT EXISTS
        (
            SELECT
                Column
            FROM
                LinkedServerName.DatabaseName.SchemaName.Table2
            WHERE
                Table1.Column = Table2.Column --looks at equalities, and doesn't
                                              --include them because of the
                                              --NOT EXISTS clause
        )
    
    UNION
    
    SELECT
        Column, 'Table2' TableName
    FROM
        LinkedServerName.DatabaseName.SchemaName.Table2
    WHERE
        NOT EXISTS
        (
            SELECT
                Column
            FROM
                DatabaseName.SchemaName.Table1
            WHERE
                Table1.Column = Table2.Column
        )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two datasets in SAS that I would like to merge, but they
I have multiple datasets that I would like to combine into one. There is
I have two tables, each one has a primary ID column as key. I
I have two types of data sets. Both are in same size. One contains
I have two tables on different servers, and I'd like some help finding an
I'm using Python 2.6, and I have two datasets, each being a list of
I have two datasets returning to two different backbone collections each using a different
If I have two different datasets in CouchDB, one is infrequently updated (mostly updates
I have a report with two separate tables referencing two separate datasets. The first
I have two data sets, each dataset contains the pixel values of an image.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.