3

I'm currently working through an example on cross database queries on SQL Azure. http://www.c-sharpcorner.com/article/cross-database-queries-in-azure-sql/

I'm currently working on the following section -

CREATE EXTERNAL DATA SOURCE RefmyDemoDB2  
WITH  
(  
    TYPE=RDBMS,  
    LOCATION='your server name',  
    DATABASE_NAME='myDemoDB2',  
    CREDENTIAL= your “Server admin login”  
);  

I'm getting the following error The specified credential cannot be found or the user does not have permission to perform this action.

I have the correct LOCATION and DATABASE_NAME however the CREDENTIAL seems wrong. I am using the Server-Admin account that is displayed in the overview of the database server on Azure, I also use this role to log into management studio and can query both databases ok.

Can anyone please advise?

1 Answer 1

2

Try this, Creating new Credentials

CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'STrongPA5swor$';

CREATE DATABASE SCOPED CREDENTIAL MyLogin
WITH IDENTITY = 'MyLogin',
SECRET = 'STrongPA5swor$';

CREATE EXTERNAL DATA SOURCE PHPSTGRemoteReferenceData
WITH
(
    TYPE=RDBMS,
    LOCATION='servername',
    DATABASE_NAME='DBName',
    CREDENTIAL= MyLogin
);

This works for me

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.