Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. comparing tables in SQL 2008

comparing tables in SQL 2008

Scheduled Pinned Locked Moved Database
databasequestionregex
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AndyInUK
    wrote on last edited by
    #1

    Hi, I have got a test table in A database with user details. Now i have imported temp table in B database with user details. Now i want to match if test & temp table contains same set of users, if not then display the extra number of users in either of the table. In temp and test table only matching value could be email id. How can i achieve this ? Thank You Andyyy

    D 1 Reply Last reply
    0
    • A AndyInUK

      Hi, I have got a test table in A database with user details. Now i have imported temp table in B database with user details. Now i want to match if test & temp table contains same set of users, if not then display the extra number of users in either of the table. In temp and test table only matching value could be email id. How can i achieve this ? Thank You Andyyy

      D Offline
      D Offline
      David Mujica
      wrote on last edited by
      #2

      Try something like this: select emailID,'Missing from B' from db_A.dbo.table1 where emailID not in (select emailID from db_B.dbo.table2) UNION select emailID,'Missing from A' from db_B.dbo.table2 where emailID not in (select emailID from db_A.dbo.table1) That should show you the differences.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups