I have the following INSERT statement:
INSERT INTO [StoreTestDB].[dbo].[KitItem]
([KitItemGUID]
,[KitGroupID]
,[Name]
,[Description]
,[PriceDelta]
,[WeightDelta]
,[IsDefault]
,[DisplayOrder]
,[ExtensionData]
,[TextOptionMaxLength]
,[TextOptionWidth]
,[TextOptionHeight]
,[InventoryVariantID]
,[InventoryVariantColor]
,[InventoryVariantSize]
,[CreatedOn])
VALUES
...
...
...
I need to run another query to find out the KitGroupID based on the name which will be a font.
Here is how i roughly want to do it:
SELECT TOP1 (KitGroupID)
FROM KitGroup
WHERE Name = "Font"
AND ProductID = 157
I have about 30 productIDs and i have many fonts.
I need to run the insert statement then while its running i need the select query to find out the KitGroupID to then finalise the insert. Does that make sense?
How can i do this, i am quite new to SQL.. Thanks in advance