SQL SERVER – Fix – Login failed for user ‘username’. The user is not associated with a trusted SQL Server connection. (Microsoft SQL Server, Error: 18452)

Earlier this week, I was on vacation and did not check my emails for three days and when I returned, I found six different emails from 4 different people asking for the same problem.

When they attempted to login using their application to SQL Server they faced following error:

Login failed for user 'username'. The user is not associated with a trusted SQL Server connection. (Microsoft SQL Server, Error: 18452)

This is quite a common error and can happen when incorrect username is communicated to SQL Server. The fix is to provide correct username. This can also happen if you are attempting to login to SQL Server with SQL Username but it is only configured to connect to Windows Login. You can quickly fix this error by following steps listed below.


Open SQL Server Management Studio and right click on Server Node and select Properties

Now go to Security Tab and go to Server Authentical Area. Select SQL Server and Windows Authentication Mode.

You should be able to login with your SQL Server username. If you are not able to login with your SQL Server username after following above steps, it is quite possible your username is incorrect, please check again.

Reference: Pinal Dave (http://blog.sqlauthority.com)

9 thoughts on “SQL SERVER – Fix – Login failed for user ‘username’. The user is not associated with a trusted SQL Server connection. (Microsoft SQL Server, Error: 18452)

  1. Thank You.. I have question here?As I tried this option, I am unable to access the User details further. I have 10 users & I am getting user group not individual user id’s. Please help me.


  2. Perhaps it was not a coincidence that these emails all came together.

    I have had an application run smoothly on 20+ sites for years, only to have this reported from two sites last week.

    The connection string was in both cases specified in an UDL file that the application refers to, and I used trusted login. The user’s Windows account will (through an AD group) give access to both the file server and the database server. They should be able access neither, or both.

    I discovered that if the application was started from an UNC path, e.g. \\server\folder\app,exe, it would gives this error, but if the server folder \\server\folder was mapped to a drive letter, thereby starting from a path like m:\app.exe, there was no problem.

    The connection strings used inside the app would be “FILE NAME=m:\app.udl” or “FILE NAME=\\server\folder\app.udl” in the two cases. The first would work, the second wouldn’t, and would give the error you mention.

    I suspect that this can be a new security “feature” of Windows itself that has been introduced in a patch. What do you think?


  3. Amigo me está pasando ese error al crear un linked server de un servidor con sql server 2008 a uno con sql server 2000 service pack 2 en donde intento acceder por medio de sql server connection, me manda ese error, y si pruebo iniciando sesión al servidor no me da error que podrá ser?

    Ya valide y si tengo la misma configuraci´n.


  4. helo sir still i am not able to connect to the database. i created one login like ‘developper’ with password ‘developper’ but it still showing the same error message.

    i am a beginer in sql dba .
    please help me

    thank you


  5. Hi Pinal,

    I have a classic situation here.

    I am using this connection string across all applications listed below.


    Server nilesh1 is configured to allow mixed mode authentication.

    Applications written in vb 6.0 are connecting smoothly with the above connection string.
    Sql Query Analyzer connects smoothly with those credentials.

    Only applications written in asp (running on a server other than nilesh1) cannot connect and give out this error.

    Any insights?

    Nilesh Deshpande


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s