How to use the output statement and insert multiple values with that id <p>I want to insert values into two tables.</p> <p>The first one looks like this</p> <p><strong>Recipes</strong></p> <pre><code>RecipeId (unique and AI) RecipeName Method Discontinued </code></pre> <p>The second one looks like this</p> <p><strong>IngredientRecipe</strong></p> <pre><code>RecipeUniqId (unique and AI) RecipeId (same as the RecipeId in the Recipes table) IngredientId </code></pre> <p>I want to insert a RecipeName and a Method. If I do that the RecipeId gets auto incremented. Than I want to insert three times an ingredient with the RecipeId. Its working for one ingredient.</p> <pre><code>INSERT INTO Recipes (RecipeName, Method, Discontinued) OUTPUT INSERTED.RecipeId, '5' INTO IngredientRecipe( RecipeId, IngredientId ) VALUES ('Potato and Chips', 'Potato and Chips bake everything', 'false'); </code></pre> <p>So what I want is that I can add three times the same RecipeId with a different number for the IngredientId.</p> <p>How to do this? I use sql server </p> <p>EDIT:</p> <p>I use asp.net with c# and an N-tier structure. I use a sql server database</p>