title: Azure SQL: Invalid Object Name using Powershell's "Invoke-sqlcmd" on Adventureworks
body: <p>I'm new to SQL, trying to query an Azure SQL Database (Adventureworks sample) using PowerShell's <code>Invoke-SQLCmd</code>.</p>
  <p>When I try the following command in Powershell:</p>
  <pre><code>Invoke-Sqlcmd -Query &quot;SELECT * FROM SalesLT.Customer;&quot; -ServerInstance 
  &quot;&lt;servername&gt;.database.windows.net&quot; -Username &lt;username&gt; -Password &lt;password&gt;
  </code></pre>
  <p>I get:</p>
  <pre><code>Invoke-Sqlcmd : Invalid object name 'SalesLT.Customer'.
  </code></pre>
  <p>Do I need to specify what Database that table is under?  Namely, &quot;SQLDatabse&quot; instead of &quot;master&quot;?  But when I add <code>Use SQLDatabase</code> to my query it throws another error:</p>
  <pre><code>USE statement is not supported to switch between databases. Use a new     
  connection to connect to a different database.
  </code></pre>
  <p><strong>Note:</strong>  Executing these queries from SQL Server Management Studio gets me the  table with no errors.</p>