Skip to content
This repository has been archived by the owner on May 7, 2024. It is now read-only.

Connections to Azure SQL DW failed due to login issue #246

Open
giri9949 opened this issue Nov 9, 2020 · 1 comment
Open

Connections to Azure SQL DW failed due to login issue #246

giri9949 opened this issue Nov 9, 2020 · 1 comment

Comments

@giri9949
Copy link

giri9949 commented Nov 9, 2020

I've got a sql-db instance on the same server as my azure data warehouse.

When executing the below query:

mssql-scripter -S server.database.windows.net -d sqldw -U not-server-admin --target-server-version AzureDW -f C:\Users\somewhere --file-per-object --exclude-use-database --display-progress --exclude-headers

I get the below error, about connecting to a database unrelated to the command.

Error details: Microsoft.SqlServer.Management.SqlScriptPublish.SqlScriptPublishException: An error occurred while scripting the objects. ---> Microsoft.SqlServer.Management.Common.ConnectionFailureException: Failed to connect to server server.database.windows.net. ---> System.Data.SqlClient.SqlException: The server principal "not-server-admin" is not able to access the database "an-azure-sql-db" under the current security context. Cannot open database "an-azure-sql-db" requested by the login. The login failed. Login failed for user 'not-server-admin'.

@bbct
Copy link

bbct commented Feb 17, 2021

When connecting to an Azure db, try using --connection-string parameter instead of -S, -d, -U, and -P parameters.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants