I could not find a solution for this yet. I want to insert multiple rows with 2 or more different hardcoded values, but also with data that I get from another table.
Example: I want to add 2 items into a table for a user that has the ID = '0' in another table without running 2 queries.
This is what I've done so far:
INSERT INTO
DB.dbo.Table WITH(ROWLOCK, XLOCK) (
col1,
col2,
col3,
col4
)
SELECT
DISTINCT customer_id,
hardcoded_value1,
constant1,
constant2
FROM
DB.dbo.Other_Table
WHERE
ID = '0';