Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Problem finding missin data between two tables

$
0
0

 I have two nearly identical tables: labprofiles, labprofiles1.  They have the same columns except labprofiles1 has a profileid column

The schema looks like this:

CREATE TABLE [Edidata].[labprofiles](
    [Provider] [varchar](10) NOT NULL,
    [TranCode] [varchar](10) NOT NULL,
    [DBase] [varchar](25) NOT NULL,
    [DBTable] [varchar](25) NOT NULL,
    [DBField] [varchar](50) NULL,
    [Segment] [varchar](5) NULL,
    [Element] [varchar](4) NOT NULL,
    [DelimitedPos] [varchar](4) NULL,
    [FieldIndex] [int] NOT NULL,
    [Org] [varchar](50) NULL,
    [LabOrg] [varchar](50) NULL,
    [Location] [varchar](50) NULL,
    [ID] [int] IDENTITY(1,1) NOT NULL,
    [Profile] [varchar](20) NULL,
    [Label] [varchar](30) NULL

CREATE TABLE [Edidata].[labprofiles1](
    [ID] [int] IDENTITY(1,1) NOT NULL,
    [ProfileId] [int] NOT NULL,
    [Provider] [varchar](10) NOT NULL,
    [TranCode] [varchar](10) NOT NULL,
    [DBase] [varchar](25) NOT NULL,
    [DBTable] [varchar](25) NOT NULL,
    [DBField] [varchar](50) NULL,
    [Segment] [varchar](5) NULL,
    [Element] [varchar](4) NOT NULL,
    [DelimitedPos] [varchar](4) NULL,
    [FieldIndex] [int] NOT NULL,
    [Location] [varchar](50) NULL,
    [Profile] [varchar](20) NULL,
    [Label] [varchar](30) NULL,
    [Org] [varchar](50) NULL,
    [LabOrg] [varchar](30) NULL

So every field should match between the two tables with exception of ID and ProfileID.

I have 38026 rows in labprofiles,  37800 rows in labprofiles1.  I need to find what is missing between the two.

Tried this query but it doesn't bring anything back.

Any suggestions would be greatly appreciated.

Thanks

Rut


Mike Rutledge


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>