title: Querying across databases with Azure SQL
body: <p>I'm trying to insert data from one database table into another database table (on the same server) in Azure SQL. I see the following: </p>
  
  <p><a href="https://azure.microsoft.com/en-us/blog/querying-remote-databases-in-azure-sql-db/" rel="nofollow">https://azure.microsoft.com/en-us/blog/querying-remote-databases-in-azure-sql-db/</a></p>
  
  <p>This describes that I should be able to do the following:</p>
  
  <pre><code>CREATE EXTERNAL DATA SOURCE RemoteReferenceData
  WITH
  (
      TYPE=RDBMS,
      LOCATION='myserver.database.windows.net',
      DATABASE_NAME='_2016-09-07-17412',
      CREDENTIAL= SqlUser
  );
  
  CREATE EXTERNAL TABLE [dbo].[RemotePhotos](
      [PhotoId] int NOT NULL,
      [Url] nvarchar(max) NULL,
  )
  WITH
  (
      DATA_SOURCE = RemoteReferenceData
  );
  </code></pre>
  
  <p>However I get the following when I run this: </p>
  
  <blockquote>
    <p>The specified credential cannot be found.</p>
  </blockquote>
  
  <p>How can I go about creating a credential for this purpose?  Is there a better way to go about this?</p>