Fix login errors of SQL Server
The cause of SQL Server logon failure may be because the default database set up for that particular logon has been deleted. To fix a failed SQL Server login error, the solution is to update the login information to create the default database.
To fix a failed SQL Server login error, follow the steps below:
First open the Command Prompt window and enter the following command:
– With SQL 2005:
Use the following command to fix a failed SQL Server login error:
osql -S SQL01 -d master -U usrlogin -P usrpassword
ALTER LOGIN usrlogin WITH DEFAULT_DATABASE = new_default_db
– With SQL 2000:
Use the following command to fix a failed SQL Server login error:
isql -S SQL01 -d master -U usrlogin -P usrpassword (opens query analyzer, type the next line in there) sp_defaultdb ‘usrlogin’, ‘new_default_db’
https://thuthuat.taimienphi.vn/sua-loi-dang-nhap-sql-server-that-bai-31492n.aspx
By running the commands that Taimienphi.vn mentioned above to fix errors of SQL Server login failure. Besides, there are also some login errors on SQL Server related to SA account that Taimienphi.vn mentioned so that you can find another method to log into SQL Server. But best of all, before doing any important work, you backup and restore SQL Server To ensure your data and information is always guaranteed, no loss. Good luck.
.