title: specific select work only when i add db name
body: <p>I'm using SQL Server 2008 Express</p>
  
  <p>All of the select statments are fine. Now I have this one:</p>
  
  <pre><code>SELECT 
     ORG.id, ORG.img, ORG.name, ORG.city, ORG.address, 
     ORG.zip, ORG.telephone, ORG.telephone2, 
     ORG.fax, ORG.email, ORG.vaname, ORG.vanumber, 
     ORG.yor_photo, ORG.commission, 
     Clients.id AS yor_id, Clients.prefix, 
     Clients.fname, Clients.lname, Clients.phone, 
     Clients.pelephone, Clients.email, Clients.pid, 
     ORG.adddate, ORG.note
  FROM Org 
  LEFT OUTER JOIN 
      (select * from Clients where yor = 1) as Clients ON Clients.company = ORG.id 
  WHERE ORG.id=" &amp; ORGID
  </code></pre>
  
  <p>It is not working, I get error "invalid object name"</p>
  
  <p>If I add the DBNAME.DBO in front of the table name it works</p>
  
  <p>The problem is that i don't want to change that on every project</p>
  
  <p>Why is it not working?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>the problem is not with the db name, the problem is with the <strong>AS yor_id</strong> in the select statment.
  if i remove it the record retrieved is not full with all the data but if i write it the data is full but yor_id is empty</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>NEVER MIND, my bad! id column was corupted</p>