次のシナリオがあります。値を挿入する2つのUDT
PFB私のクエリ
DECLARE @termlength AS Prdctlg.ContractTermLengthType;
DECLARE @PromotionIdsTable AS Prdctlg.PromotionsType
INSERT INTO @termlength (PromotionName,
PromotionStartDate,
PromotionEndDate,
PromotionDescription,
TermLengthPrice,
LengthInMonths)
VALUES ('CT1', '02/02/2017', '02/02/2019', 'Desc', '12', '15')
INSERT INTO @termlength (PromotionName,
PromotionStartDate,
PromotionEndDate,
PromotionDescription,
TermLengthPrice,
LengthInMonths)
VALUES ('CT12', '02/02/2017', '02/02/2018', 'Desc13', '122', '152')
INSERT INTO PrdCtlg.Promotions (PromotionName, PromotionStartDate, PromotionEndDate, PromotionTypeId)
OUTPUT INSERTED.pkPromotionsId INTO @PromotionIdsTable (PromotionsId)
SELECT
PromotionName,
PromotionStartDate,
PromotionEndDate,
1
FROM @termlength
SELECT
*
FROM @PromotionIdsTable
SELECT
*
FROM @termlength
私は@termlength TermLengthIdに@PromotionIdsTable UDTのこれらの値を挿入します。どの働かはあり
ここ
、 –
あなたが意味するか私達にあなたの試みとサンプルデータを表示してください:*同じ* 'PromotionsId 'しかし、異なる'プロモーション記述 '? – Richard
どの行を削除しますか?どの行が正しいかを決定する必要があります –