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

Validate each parent intermediary is also a parent to itself?

$
0
0

I have a table for which I want to validate where each parent intermediary is also a parent to itself. How to write query to validate this?

COLUMN                      DATATYPE        DESCRIPTION
IntermediaryPK              int 
SourceSystemID              tinyint         Intermediary source
IntermediaryID              nvarchar(20)    Intermediary ID
IntermediaryName            nvarchar(200)   Intermediary name
IntermediaryTypeID          nvarchar(1)     Intermediary type
ParentIntermediaryID        nvarchar(20)    Intermediary parent
IntermediaryTypePK          tinyint         Intermediary type
IntermediaryCategoryPK      smallint        Intermediary category
ParentIntermediaryPK        int             Parent intermediary PK
GrandParentIntermediaryPK   int             Grand parent intermediary PK

Viewing all articles
Browse latest Browse all 23857

Trending Articles



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