Last post Aug 16, 2020 03:36 PM by wmec
Aug 16, 2020 07:48 AM|klbaiju|LINK
Iam using sql server 2019.
I want to connect through sql server authentication mode.
i can connect throgh windows authentication mode.
I have connected to sqlserver using windows authentication and click security and login sa is there.
i have changed the password of sa and tried to login but it is showing following error
Login failed for user 'sa'. Reason: Server is in single user mode. Only one administrator can connect at this time. (.Net SqlClient Data
How to solve this
Aug 16, 2020 08:22 AM|PatriceSc|LINK
The first problem is that SQL Server seems currently started in single user mode (which is used for heavy maintenance operations) as pointed by the error message. See https://www.sqlshack.com/different-ways-to-start-a-sql-server-single-user-mode/
Is this expected? You may want to restart SQL Server (and possibly undo first this configuration change) to resume normal operation or ask those in charge of SQL Server inside your company.
- by default SQL Server uses Windiows authentication, you may have to enable this: https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/change-server-authentication-mode?view=sql-server-ver15
- an application usually doesn't use the sa account but its own account with just the needed permissions
Aug 16, 2020 03:36 PM|wmec|LINK
Try and use
-m "Client Application Name"
When you use the -m option with SQLCMD or SQL Server Management Studio, you can limit the connections to a specified client application. For example, -m"SQLCMD" limits connections to a single connection and that connection must identify itself as the SQLCMD client program. Use this option when you are starting SQL Server in single-user mode and an unknown client application is taking the only available connection. To connect through the Query Editor in Management Studio, use -m"Microsoft SQL Server Management Studio - Query".