When you attempt to login to your database using SQL Server Authentication, you may get an error saying "Login failed. Login fail for user `usrLogin`. (Microsoft SQL Server, Error: 4064)". This problem may occur if the database that was set to be the default for that specific login was deleted.
Steps
Update the login to have a default database that you know exists. Here’s how to fix it. Open a command prompt and type the following:
SQL 2005
1 osql -S SQL01 -d master -U usrlogin -P usrpassword
ALTER LOGIN usrlogin WITH DEFAULT_DATABASE=new_default_db
Method 2
SQL 2000
isql -S SQL01 -d master -U usrlogin -P usrpassword (opens query analyzer, type the next line in there) sp_defaultdb ‘usrlogin’, ‘ new_default_db’
0 comments:
Post a Comment