SQLTeam.com | Weblogs | Forums

Cannot connect tp SQL Server

Hi all,
Here's my problem:
I cannot connect tp SQL Server. Getting this error message: cannot open user default database.
Please help me to repair SQL database.

You need permission to access your default database. When the user was setup, it defaults to a database if not set manually. Whatever it is set to you do not have permissions to. Have your admin change the database or give permission where applicable.

Not sure, but might also be possible that the database previously set as the DEFAULT for the user has since been dropped - i.e. no longer exists.

Perhaps nowadays SQL handles that [when the DB is dropped] and/or gives a more appropriate error message

I want to say thank you for taking the time to share how to go about fixing this.

Hello,
Each user has a default database. When you connect to computer that is running Microsoft SQL Server, and you do not specify a login database, the default database is used. To avoid the error try this app https://www.sqlserverrepairtoolbox.com/

It repairs data types, views, procedures, tables, keys, indexes and other objects

1 Like

Thank you for the detailed and informative answer.