Skip to content
Advertisement

How to Insert combining two different selects in SQL Server?

I want to insert into a table as part of a longer procedure using SQL Server 2008. The table for the insert has two columns, itemID and tag.

The tag part is selected from an input parameter (xml) and works as intended with the line below. My problem is that the itemID needs to be selected from a temp table (@temp) at the same time. How can I achieve this here ?

My SQL (only relevant part):

Advertisement

Answer

Just perform a CROSS JOIN:

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement