How to generate a unique ID for every insert statement in SQL Server?
<p>I want to give a unique ID for every insert statement I make, this is so I can see what rows was inserted together. I prefer that the unique "insert ID" start at 1 and increases by one like the <code>IDENTITY(1,1)</code> for rows. </p>

<p>Is there a easy way like <code>IDENTITY</code> to do that?</p>

<pre><code>CREATE TABLE [dbo].[factTrade] 
(
      [ID] [int] IDENTITY(1,1) NOT NULL,
      [insertedID] [int] NOT NULL,
      [quantity] [int] NOT NULL,
      [price] [decimal](20, 10) NOT NULL
)

INSERT INTO [dbo].[factTrade] ([insertedID], [quantity], [price])
VALUES (1, 6, 2.5), (1, 4, 3.7), (1, 3, 4.1), (1, 7, 8.5),

INSERT INTO [dbo].[factTrade] ([insertedID], [quantity], [price])
VALUES (2, 5, 5.2), (2, 1, 4.6)   
</code></pre>