title: Is there any way to use SCOPE_IDENTITY if using a multiple insert statement?
body: <p>I will import many data rows from a csv file into a SQL Server database (through a web application). I need the auto generated id value back for the client. </p>
  
  <p>If I do this in a loop, the performance is very bad (but I can use <code>SCOPE_IDENTITY()</code> without any problems).</p>
  
  <p>A more performant solution would be a way like this:</p>
  
  <pre><code>INSERT INTO [MyTable]
  VALUES ('1'), ('2'), ('3')
  SELECT SCOPE_IDENTITY()
  </code></pre>
  
  <p>Is there any way to get all generated IDs and not only the last generated id?</p>
  
  <p>Thanks for your help!</p>
  
  <p>Best regards,
  Thorsten</p>