"Login failed for user ''(null)''. Reason: Not associated with a trusted SQL Server connection"

  • I've been successfully developing a windows forms / MS-SQL2000 application. Now I'm deploying this window app to a newly installed Windows SQL server and recieving the following error:

    "Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection"

    I'm not new to MS SQL 2000 and sure all permissions are correctly set.

    1. Installed new Windows 2003 Server,SP1 and all Windows Updates

    2. Installed new MS SQL Server 2000, SP4, MDAC 2.7

    3. Copied tables from original server and successfully 'Attached' it to the new SQL server.

    4. Query Analyzer successfully queries the database.

    5. I'm running everything locally on the new server as the Server Administrator.

    Don't know what to do now.....  Any suggestions?

    Connection strings are not a problem.  

    I can connect to the new server from my windows 2000 pro using query Analyzer like I still can connect with the original server.

    I can also run my win app from my development workstation and connect to the new server just fine as well as the old.

    Its a mystery to my why I cannot local run the very same win app on the new SQL 2000 server.

  • Had this problem for one of my client. Spent 3 days to determine the problem. There can be several reasons for this error. Let us know whether this problem occurs ever time or only sometime. Do you get this error even with Enterprise or QA or this is just from application.  I am not able to access my email account or I would posted some links to you. All the best.

    Kindest Regards,

    Amit Lohia

  • 1. Win App error occurs everytime on local server, not remotely.

    2. Enterprise Mgr (on remote workstation) connects successfully.

    3. Query Analyzer (on remote workstation) connects successfully.

  • Is server in mixed mode or windows only mode?

    Are you connectiong w/ sql login, or domain account?

    that error only indicates that sql server does not know who you are. No spid.

    Or not using Spid

    Usually see this when server is not mixed mode, but using sql logon.


  • I have reinstalled SQL twice now thinking the first install was corrupt.

    1. First install was Windows Mode, no luck.

    2. Second install was Mixed Mode, no luck.

    3. I tried both the traditional  and integrated connection string without any local results. 

    I believe its an incompatibility between Windows 2003 Server and Windows SQL 2000 that hinders Windows apps from local logon and accessing SQL.

    It's a strange thing that I can run my windows app remotely (via VS-2003) from a Windows 2000 Pro Workstation and connect to the same troubled 2003 Server, using the same connection string) without any problem. It works like a dream.

    Also, my workstation Enterprise Manager, Query Analyzer, and Profiler all login and run flawlessly to the same troubled 2003 server. I just don't get it.




  • What is the connection string then? Who are you logged on as when the error occurs?

  • Look in the SQL Server Login for BUILTIN\Administrators, does it have the sysadmin role? If it is not there at all then what SQL Server login/roles are your AD accounts using for SQL Server login?

    KB for info for removal of the BUILTIN\Administrators SQL Server login:


    KB Article about the User '(null)'


    Google search shows many threads to lookup "Login Delegation" in BOL.

    There is also a good article:



  • Are you connecting with a domain account or with a SQL Server login?  Have you tried dropping the login (NT or SQL) and recreating it them granting it access to the database again?  It sounds as if there is a disconnect with the SID on the login from the test/development environment to the production environment.

  • Have you tried using the sp_change_users_login to see if there are orphaned users?  Also sp_validatelogins for the domain users.

  • After trying the sp_change_users_login, if the problem still exists, you may want to go into the services applet to see if any of the services needed by sql server are disabled.  Win 2003 server by default disables everything that it does not need for basic operation.  This is to reduce potential security risks.  Go through them and see if you need to set a startup to automatic or manual for any of the services needed for authentication

    Karen Gayda


  • I have the reverse issue. If I login to the server as a Domain Account (using remote desktop) I can login to the SQL Server Instance using windows authentication (using query analyzer). If I try to login using query analyzer with the same domain account from a workstation in that domain I get the Login Failed for (null) user error.

    Any help would be appreciated.

  • Ken - Were you able to resolve your issue? I have the exact same problem.

  • From that workstation do you have an IPC$ share to the server hosting the sql instance?

  • Sorry, I'm not sure what an IPC$ share is.

  • If you are asking if folders on the server are shared out that I can access, the answer is yes.

Viewing 15 posts - 1 through 15 (of 18 total)

You must be logged in to reply to this topic. Login to reply