The default database cannot be opened. Logon fails because the default database of the logon account is deleted.
The solution is to use the administrator account to modify the default database of the logon account.
1. Log on to the enterprise manager using the administrator account. In "object Resource Manager", choose "security"> "logon name", right-click the Account, and click "properties"
2. In the "logon properties" dialog box, change the default database on the right of the first "General" tab.
If the problem is caused by your administrator account and you cannot log on to the Enterprise Manager to modify it, run the following command,
In SQL Server 2000, open the CMD command prompt and use the following command:
SQL Account logon method: isql-U "password"-P "jtydl"-d "master"-Q "exec sp_defaultdb N 'sa ', N 'master '"
Windows Authentication logon method: isql-E-d "master"-Q "exec sp_defaultdb N 'builtin/Administrators ', N 'master '"
SQL Server 2005 users cannot use the isql command, because SQL 2005 does not have isql, and isql usage is reproduced on the Internet without saying that this command is not available in SQL 2005.
After more than half an hour, I finally found SQL2005, but added a sqlcmd command to replace isql. You only need to replace isql with sqlcmd.
Area input.
The general cause of this error:
1. The default database is deleted by mistake.
2. When the default database is used to restore the database, another physical path is used to restore the database. The above error may occur.