title: Insert values into multiple SQL tables
body: <p>What is a good method to insert table data that replies on many tables in C# and SQL server?</p>
  
  <p>So for example say I have the following tables:</p>
  
  <pre><code>Products: PK=PID, Product_Name
  Build: PK:BID, Build_Number, FK:PID
  Files: PK:FID, File_Name, FK:PID
  FileDetails: PK:FDID, FK:FID, FK:BID, File_Size, File_Version
  </code></pre>
  
  <p>So all the Primary Keys are auto incremented numbers</p>
  
  <p>So I have an xml file, in there I have rows of information such as:</p>
  
  <pre><code>Product_Name ,Build_Number,File_Name,File_Size,File_Version
  FooCreator1.0,112233      ,foo.exe  ,123456   ,3.5
  FooCreator1.0,112233      ,bar.exe  ,234567   ,1.5
  </code></pre>
  
  <p>I want to be able to add the rows to my tables. Imagine my database is empty.</p>
  
  <p>Do I first have to add all the products, then add all the builds, then add all the files, then join all the tables and then add all the file details?</p>
  
  <p>EDIT: I will have around 20'000 rows and I will be storing around 40 values per line in the final unique table.</p>