I'm trying to insert data into two tables [Product]., it's inserting into one of the tables not inserting `[Product]. It returns an empty table. Not sure how to handle multiple inserts in the stored procedure:
I'm trying to insert data into two tables [Product]., it's inserting into one of the tables not inserting `[Product]. It returns an empty table. Not sure how to handle multiple inserts in the stored procedure:
Try this
INSERT INTO [Product].[LKStandardProductGroup]
([StandardProductGroupID],[StandardProductID])
SELECT
@StandardProductGroupID as [StandardProductGroupID] ,
value as [StandardProductID]
FROM STRING_SPLIT(@StandardProductCodes,',') inp
INNER JOIN [Product].[StandardProduct] sp WITH(NOLOCK)
ON sp.[StandardProductID] = inp.value