Copy Drivers, Root Cause, etc. for new sample
Overview
When a new sample is created for the new sample architecture, the sample needs metadata such as drivers and root causes added. At times Business wants these to be based off an existing sample.
Steps
- Ensure business has added the Sample in Sample Setup
- Ensure the new Sample does not have any other indicators already added prior to creating the script.
- Have Script 1 run as a SAFE script, changing the variables for the relevant sample numbers.
Script 1
declare @OriginalSampleNo int = 29
declare @NewSampleNo int = 29
insert into smart.p11_codelist (lookupno, LookupTitle, LookupCategory, Option1, Option7)
select lookupno, LookupTitle, LookupCategory, Option1, @NewSampleNo from smart.p11_codelist where lookupcategory in ('driver', 'root cause', 'pend reason code', 'priority', 'removalreason')
and option7 = @OriginalSampleNo and LookupTitle != 'First In First Out' and CurrentStatus = 1 and Deleted = 0
order by LookupCategory, LookupNo