title: How do I insert into two tables all at once in a stored procedure?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/3712678/how-can-i-insert-data-into-two-tables-simultaneously-in-sql-server">How can I INSERT data into two tables simultaneously in SQL Server?</a>  </p>
  </blockquote>
  
  
  
  <p>Doing a project for school so any help would be great thank you!</p>
  
  <p>I have two tables - how do I insert into two tables? So both tables are linked.</p>
  
  <p>First table is called <code>Customer</code> with primary key called <code>CID</code> that auto increments</p>
  
  <pre><code>CREATE TABLE [dbo].[Customer](
      [CID] [int] IDENTITY(1,1) NOT NULL,
      [LastName] [varchar](255) NOT NULL,
      [FirstName] [varchar](255) NOT NULL,
      [MiddleName] [varchar](255) NULL,
      [EmailAddress] [varchar](255) NOT NULL,
      [PhoneNumber] [varchar](12) NOT NULL        
   CONSTRAINT [PK__CInforma__C1F8DC5968DD69DC] PRIMARY KEY CLUSTERED 
  (
  </code></pre>
  
  <p>And a second table called <code>Employment</code> that has a foreign key linked to the parent table</p>
  
  <pre><code>CREATE TABLE [dbo].[Employment](
      [EID] [int] IDENTITY(1,1) NOT NULL,
      [CID] [int] NOT NULL,
      [Employer] [varchar](255) NOT NULL, 
      [Occupation] [varchar](255) NOT NULL,
      [Income] [varchar](25) NOT NULL,
      [WPhone] [varchar](12) NOT NULL,
   CONSTRAINT [PK__Employme__C190170BC7827524] PRIMARY KEY CLUSTERED 
  (
  </code></pre>