Quantcast
Channel: SQL Server Database Engine forum
Viewing all articles
Browse latest Browse all 5123

Looking for store procedure update child to parent and parent becomes child.

$
0
0

 I need a store procedure which pass ID and ParentBrandID, and update from child to parents and all preexisting child's parent Brand value also changed to new parentsBrandID eg update table set parentbrandID is null where ID =388 now AccutechLabels  record's  parentID  will become null ,and Accutech's parentID should be 388 and all 167 should replace by 388.

ID	Brand	ParentBrandID
167	Accutech	Null
385	Accu-Tech	167
386	Accutech Compatbles	167
387	Accutech Corporation	167
388	Accutech Labels	167
389	ACM	195
1465	ACM Tech	195
195	ACM Technologies	Null
1412	ACM Technologies,Inc.	195
2070	ACM02	195
1464	ACMTech	195
2913	ACMTechnologie sINC	195

2913ACMTechnologie sINC195



Viewing all articles
Browse latest Browse all 5123

Trending Articles



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