title: Conditional FROM clause
body: <p>My coworkers are using entity framework and have got 3 (schematically) identical databases. These databases are updated and modified by their application. I am writing another, separate application to gather information about their application.</p>
  
  <p>I am trying to use stored procedures but having trouble. It seems I must have three copies of my query in every stored procedure (one for each database) and <code>JOIN</code> them all at the end. I don't want to have three copies of every query with only the table name changed. Can I specify using a parameter, CASE statement, or something else the table I use in my FROM Clause?</p>