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

Finding records

$
0
0
  I have exported texr file data to Table Imp 

 SELECT  BmpShortname,StateAbbreviation,LanduseGroup,Unit  FROM dbo.Imp 

Result:   

Shortname  StateAbbreviation  LanduseGroupUnit
PastFenceVAtrpacres
ConPlanTX urbanAcres
BioRetUDABDEUrbanWithCssacres
BioRetUDABDE UrbanWithCssacres
BioRetUDABDE UrbanWithCssacres
BioRetUDABDE UrbanWithCssacres
BioSwaleDE UrbanWithCssPercent
BioSwaleDC RowAU
BioSwaleNY UrbanWithCssacres
BioSwaleNYUrbanWithCssacres

I have an Exclusive table :Tbl

IdShortName ExIdStateAbbreviation
5NutMan 211DC
5NutMan 211DE
5NutMan 211MD
5NutMan 211NY
5NutMan 211PA
5NutMan 211VA
5NutMan 211WV
5NutMan 212DC
5NutMan 212DE
5NutMan 212MD
5NutMan 212NY
5NutMan 212PA
5NutMan 212VA
5NutMan 212WV
5NutMan 213DC
5NutMan 213DE
5NutMan 213MD
5NutMan 213NY
5NutMan 213PA
5NutMan 213VA
5NutMan 213WV
6EnhancedNM 211DC
6EnhancedNM 211DE
6EnhancedNM 211MD
6EnhancedNM 211NY
6EnhancedNM 211PA
6EnhancedNM 211VA
6EnhancedNM 211WV
6EnhancedNM 212DC
6EnhancedNM 212DE
6EnhancedNM 212MD
6EnhancedNM 212NY
6EnhancedNM 212PA
6EnhancedNM 212VA
6EnhancedNM 212WV
6EnhancedNM 213DC
6EnhancedNM 213DE
6EnhancedNM 213MD
6EnhancedNM 213NY
6EnhancedNM 213PA
6EnhancedNM 213VA
6EnhancedNM 213WV
7DecisionAg 211DC
7DecisionAg 211DE
7DecisionAg 211MD
7DecisionAg 211NY
7DecisionAg 211PA
7DecisionAg 211VA
7DecisionAg 211WV
7DecisionAg 212DC
7DecisionAg 212DE
7DecisionAg 212MD
7DecisionAg 212NY
7DecisionAg 212PA
7DecisionAg 212VA
7DecisionAg 212WV
7DecisionAg 213DC
7DecisionAg 213DE
7DecisionAg 213MD
7DecisionAg 213NY
7DecisionAg 213PA
7DecisionAg 213VA
7DecisionAg 213WV

211EffNutManVA5DC
211EffNutManVA5DE
211EffNutManVA5MD
211EffNutManVA5NY
211EffNutManVA5PA
211EffNutManVA5VA
211EffNutManVA5WV
211EffNutManVA6DC
211EffNutManVA6DE
211EffNutManVA6MD
211EffNutManVA6NY
211EffNutManVA6PA
211EffNutManVA6VA
211EffNutManVA6WV
211EffNutManVA7DC
211EffNutManVA7DE
211EffNutManVA7MD
211EffNutManVA7NY
211EffNutManVA7PA
211EffNutManVA7VA
211EffNutManVA7WV
212EffNutManDecAgVA5DC
212EffNutManDecAgVA5DE
212EffNutManDecAgVA5MD
212EffNutManDecAgVA5NY
212EffNutManDecAgVA5PA
212EffNutManDecAgVA5VA
212EffNutManDecAgVA5WV
212EffNutManDecAgVA6DC
212EffNutManDecAgVA6DE
212EffNutManDecAgVA6MD
212EffNutManDecAgVA6NY
212EffNutManDecAgVA6PA
212EffNutManDecAgVA6VA
212EffNutManDecAgVA6WV
212EffNutManDecAgVA7DC
212EffNutManDecAgVA7DE
212EffNutManDecAgVA7MD
212EffNutManDecAgVA7NY
212EffNutManDecAgVA7PA
212EffNutManDecAgVA7VA
212EffNutManDecAgVA7WV
213EffNutManEnhanceVA5DC
213EffNutManEnhanceVA5DE
213EffNutManEnhanceVA5MD
213EffNutManEnhanceVA5NY
213EffNutManEnhanceVA5PA
213EffNutManEnhanceVA5VA
213EffNutManEnhanceVA5WV
213EffNutManEnhanceVA6DC
213EffNutManEnhanceVA6DE
213EffNutManEnhanceVA6MD
213EffNutManEnhanceVA6NY
213EffNutManEnhanceVA6PA
213EffNutManEnhanceVA6VA
213EffNutManEnhanceVA6WV
213EffNutManEnhanceVA7DC
213EffNutManEnhanceVA7DE
213EffNutManEnhanceVA7MD
213EffNutManEnhanceVA7NY
213EffNutManEnhanceVA7PA
213EffNutManEnhanceVA7VA
213EffNutManEnhanceVA7WV

I have to check if in my table Imp :against my exclusive table 

EX:if state VA  have submitted with shortname :"NutMan" which id is 5 , it should not submit  with shortname EffNutManVA which is 211 and EffNutManDecAgVA(212 ) and EffNutManEnhanceVA  (213) anymore

like wise  , if State VA have submitted with EffNutManVA  which is 211 it should not submitt with NutMan(5 ), 6(EnhancedNM) ,7 (DecisionAg) anymore , 

if submitted:

Ex If VA Subnitted with short name  Nutman id 5 , and also EffNutManVA  211  i have to find those records and throw error

Bottomline: Mutually exclusive BmpShortnames are not submitted with the same StateAbbreviation 


Viewing all articles
Browse latest Browse all 23857

Trending Articles



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