Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The parameter PASSWORD cannot be provided for users that cannot authenticate in a database

When I log in to azure portal select my SQL Database -> Tools -> QueryEditor and enter:

ALTER USER MyUser WITH Password = '**********'

I get the error:

Failed to execute query. Error: The parameter PASSWORD cannot be provided for users that cannot authenticate in a database.

I've created the user in Visual Studio Database Project in MyUser.sql (Build Action=Build):

CREATE USER [My_User] WITHOUT LOGIN WITH DEFAULT_SCHEMA=[dbo];

Why I'm getting the message?

Is it possible to create the User in Database Project so that I will specify the password later (not is source code)?

like image 980
Liero Avatar asked Oct 16 '17 08:10

Liero


People also ask

What is the password for Windows Authentication in SQL Server?

Connecting Through Windows AuthenticationSQL Server does not ask for the password, and does not perform the identity validation. Windows Authentication is the default authentication mode, and is much more secure than SQL Server Authentication.

How do I change my SA password in Azure SQL?

To reset the password for the server admin, go to the Azure portal, click SQL Servers, select the server from the list, and then click Reset Password. To reset the password for the SQL Managed Instance, go to the Azure portal, click the instance, and click Reset password.

What is SQL Server authentication username and password?

Instance_name is the SQL Server instance name. Username is the user name that is used to login to the SQL server. Password is the password of the user. This parameter is required if username is provided.


1 Answers

Your user is not a contained database user that can be authenticated by database. This is because you did not create it with syntax

CREATE USER user_name WITH PASSWORD = 'strong_password';

What you've created is a "traditional" user without login, in "traditional" model user cannot have a password, only the corresponding login can. But your user has no corresponding login as it was created without login, so you cannot change a password at all.

Here you can find more detailes about contained database urers: Contained Database Users

like image 122
sepupic Avatar answered Oct 20 '22 04:10

sepupic