declare @ownerId int = ; declare @ownerType varchar(3) = ; declare @formId int = ; update tbl_WRK_Forms set ccSubmission = 'Y''N' where ownerId = @ownerId and ownerType = @ownerType and formId = @formId declare @ownerId int = ; declare @ownerType varchar(3) = ; declare @formId int = ; delete from tbl_WRK_FormRecipients where ownerId = @ownerId and ownerType = @ownerType and formId = @formId insert into tbl_WRK_FormRecipients ( ownerId, ownerType, formId, recipientType, recipientUserId ) values ( , , , , ) select fieldId from tbl_WRK_Fields with(nolock) where ownerId = and ownerType = and category = and name = insert into tbl_WRK_FormRecipients ( ownerId, ownerType, formId, recipientType, recipientUserId, sourceFieldId, sourceFieldOp, sourceFieldValue ) values ( , , , , , , , )