title: quering remote database using sql server?
body: <p>I have used sp_addlinkedserver to access the remote machines db now i am writing queries explicitly on database like,</p>
  
  <p>select * from  [server\instance].database.owner.tablename</p>
  
  <p>Now with this,</p>
  
  <ol>
  <li>[Server\instance] : this has to be provided explicitly</li>
  <li>[database] : can we find databases on specified instance using query like ms_ForEachDB ? </li>
  <li>[owner] : Can we find the database owner name using query ?</li>
  </ol>
  
  <p>If these values are found using queries do we need to use EXEC() to execute this or we can still achieve it using nice queries ?</p>
  
  <p>Thanks all,</p>