How can I update a table like this?:CertMana_Offers tableCert_manaOffers_id bigintOffer_num bigint (FK Offer_id)Certificate_Mana smallint (FK Certificate_id)With these returned parameters?: (which updates the Certificate_Mana column up to 7 possible rows) @Certificate_Management0 smallint = nulll, @Certificate_Management1 smallint = null, @Certificate_Management2 smallint = null, @Certificate_Management3 smallint = null, @Certificate_Management4 smallint = null, @Certificate_Management5 smallint = null,@Certificate_Management6 smallint = null
To make the first insert, I do it thus:...SET NOCOUNT OFF SET @Offer_id = SCOPE_IDENTITY()SET NOCOUNT ONINSERT INTO CertMana_Offers (Offer_num, Certificate_Mana)SELECT @Offer_id, Certificate_ManaFROM ( SELECT @Certificate_Management0 As Certificate_Mana UNION ALL SELECT @Certificate_Management1 UNION ALL SELECT @Certificate_Management2 UNION ALL SELECT @Certificate_Management3 UNION ALL SELECT @Certificate_Management4 UNION ALL SELECT @Certificate_Management5 UNION ALL SELECT @Certificate_Management6 ) AllCerts WHERE Certificate_Mana IS NOT NULL
How can I make the ‘Update’ version for a specified ‘@Offer_id’?Thanks