SQL Server 2014 Error message in error log

k shaz 36 Reputation points
2020-09-09T18:38:10.353+00:00

i am having this error message in sql error log kindly advise where to start looking for the solution

Message
[298] SQLServer Error: 4060, Cannot open database "ABC" requested by the login. The login failed. [SQLSTATE 42000]

SQL Server | Other
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. Tom Phillips 17,781 Reputation points
    2020-09-09T18:53:48.647+00:00

    A user logged in and specified an initial database "ABC" which does not exist or the user does not have access too.

    0 comments No comments

  2. k shaz 36 Reputation points
    2020-09-09T18:57:13.787+00:00

    not sure how to find which user is trying to access?

    0 comments No comments

  3. Erland Sommarskog 128.9K Reputation points MVP Volunteer Moderator
    2020-09-09T21:08:53.89+00:00

    That message is in the SQL Server error log? That is somewhat unexpected, because this is the message you would see at the client. The message in the SQL ERRORLOG when someone tries to login on the server, providing a non-existing database in the connection string is like this:

    Login failed for user 'SOMMERWALD\sommar'. Reason: Failed to open the explicitly specified database 'kkkk'. [CLIENT: <local machine>]

    Possibly this could be an error from attempt to access a linked server set up with MSDASQL (rather than the normal SQLNCLI11). But a login error on a linked server would normally not result in a message in the SQL Server error log. For that to happen, it would have to be some system process of some sort. For instance, an activation procedure for Service Broker.

    Or are you actually looking in the Windows Event Log?

    0 comments No comments

  4. CathyJi-MSFT 22,406 Reputation points Microsoft External Staff
    2020-09-10T05:40:16.733+00:00

    Hi @k shaz ,

    Please refresh databases list check if ABC database still exist in your SQL instance. Please check the information around the error message to find some useful information. Or you can share us a screenshot about your issue.

    Best regards,
    Cathy


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.