title: "Invalid Column Name" - Query Fails
body: <p>I have a rather large query that I run on a particular database. What this query does is select specific columns from specific tables and dumps them into a new table. The new table is used and modified later in the query.</p>
  
  <p>The problem I'm running into is, while the databases are supposedly from the same program, one database might have columns email1, email2, and email3 but the next one might only have email1. Because email1-3 are used as a part of the select statement, when one of these columns is missing, that portion fails and the table never gets created.</p>
  
  <p>I'm still very much new to this so my question may be simple or silly but is there any way to save the results when a column is missing like this? I could just as easily just remove the columns that are missing from the query and run it again but I'm wondering if there is a more correct way to do this?</p>
  
  <p>Example:</p>
  
  <pre><code>SELECT  Customer.[Name], 
      Customer.AcctKey, 
      SUBSTRING(Customer.LastName,1,25) AS [Last Name], 
      SUBSTRING(Customer.FirstName,1,25) AS [First Name], 
      Customer.Add1 AS Address, 
      Customer.Add2 AS Address2, 
      Customer.City, 
      Customer.State,                 
      Customer.Zip, 
      Location.Add1 AS [Ship Address], 
      Location.Add2 AS [Ship Address2], 
      Location.City AS [Ship City], 
      Location.State AS [Ship State], 
      Location.Zip AS [Ship Zip], 
      Customer.Phone1 AS Phone, 
      Customer.Phone2 AS [Alt Phone],
      Customer.Phone3 AS [Cell Phone],
      Customer.Phone4 AS Fax, 
      Customer.lblPhone1, 
      Customer.lblPhone2, 
      Customer.lblPhone3, 
      Customer.lblPhone4, 
      Customer.Terms, 
      Customer.[Key] AS [Account Number], 
      Location.Notes, 
      Location.TaxCode AS [Tax Item], 
      Location.Zone AS [Map Code], 
      Location.Contact, 
      Location.Email, 
      Location.Email6, --Fails because column(s) Email2-6
      Location.Email5, --don't exist in this database
      Location.Email4, --but they might in another
      Location.Email3, --and I'd like to get the data
      Location.Email2, --if they do
      Location.Phone6, 
      Location.Phone5
  
  INTO [01Parents]
  FROM Customer 
  INNER JOIN Location ON Customer.[Key] = Location.[Key]
  </code></pre>