I just did an install of MS SQL SERVER 2019 on Windows 10.
I created a test sql authentication login (login name: test)
When I try to connect from the command line (from either cmd or powershell) the connection fails with the following error message: Password: Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Login failed for user 'test'..
sqlcmd -U test -P password
--or--
sqlcmd -U test (and fill in the password at the prompt)
If I don't specify login credentials, it uses my windows credentials and the connection works.
What do I need to do to be able to get sqlcmd to login with one of the sql authentication logins I create?
thanks
You need to set the Server Authentication to SQL Server and windows Authentication mode, to do that:
In SSMS Object Explorer right click on Server Node and click properties
In the left pane, click on Security

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With