I'm trying to write a SQL script that inserts 2 rows into a table thus:
INSERT INTO [table1]
([Id]
,[Name]
,[SequenceNo]
,[EntityId])
VALUES
(<newid(), uniqueidentifier,>
,<'SpecificName1', nvarchar(255),>
,<1, int,>
,</*Here's where I need help*/>)
INSERT INTO [table1]
([Id]
,[Name]
,[SequenceNo]
,[EntityId])
VALUES
(<newid(), uniqueidentifier,>
,<'SpecificName2', nvarchar(255),>
,<2, int,>
,</*Here's where I need help*/>)
"EntityId" is a foreign key to a table I call "Entities" here.
Is there a way I can insert 2 of these rows for each row I have in "Entities" (with the respective Entity's Id column value as the value for table1's EntityId column without using a cursor ?