title: Using runas command to remotely logging into SQL Server
body: <p>I am stuck at this point using the runas command. I am trying to log into a remote SQL Server instance using Windows Authentication on that server. I am using this command -</p>
  
  <pre><code>runas /netonly /user:Domain\Username 
        /server=someIP "C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\Ssms.exe"
  </code></pre>
  
  <p>But when I do this, it opens up my Management Studio - the IP is of the remote server, Windows authentication is selected by default and I have my current system's domain and username. </p>
  
  <p>I actually need a way to specify a connection string to log into a remote SQL Server and fire queries on it. It's cross domain.</p>
  
  <p>One more question - do I need to have Management Studio on the machine I fire the query from?</p>
  
  <p>Thanks.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I am rephrasing for better understanding.</p>
  
  <p>I have server A and server B(two separate computers). I need to fire a query from A on B. A does not have any sql server or management studio. B has both. I have to use windows authentication(something like myDomain\username) to log-in into sql server of B. I am using the runas command that I mentioned in the 'Target' in the properties of management studio on B. Is that wrong? 
  I am logging in into A using a different username(but same domain) as that I have to login into B. 
  How do I accomplish this task?</p>
  
  <p>Thanks and sorry for the late edit. </p>