8

The question here is different from 1 & 2

When trying to connect to a SQL Server database that is on another system in the network both are in workgroup, when attempting to connect to a SQL Server 2008 instance using SQL Server Management Studio with Windows authentication, I get connected.

But when trying to connect from my application, I get the following error

(Login failed. The login is from an untrusted domain and cannot be used with Windows authentication.) Native=18452).

If SQL Server Management Studio can connect, what would be required for my application to get connected?

1
  • It worked after I used same account as on the mssql server.
    – user30638
    Commented Nov 18, 2013 at 11:14

1 Answer 1

4

Since you are running in a workgroup the only possible authentication is one using 'mirrored NT accounts', which means that the process trying to authenticate must be running under an identity that is 'mirrored' on the host that is authenticating the process. 'Mirrored' accounts are distinct local accounts with identical name and password on both hosts doing the authentication.

So it must follow that you're running SSMS from an account that it is mirrored on the SQL Server host (eg. <computername>\Administrator, which is mirrored by the <sqlhost>\Administrator and has the same password). Note that UAC has nothing to do here (ie running as administrator will not help).

Your application is probably running under a different local account (default IIS appool perhaps?) and the account under which the application runs is not mirrored on the SQL Server host.

Your best solution is to ditch the makeshift network and deploy a proper AD (domain). As an interim, make sure you run your application under an account that is mirrored on thew SQL Server host machine.

1
  • Yes the authentication needs mirrored!. My application which is a service was running under different windows account(x) than the SQL Server Management Studio. This windows account (x) is also present in the other system, but both had different passwords!!!!!!! I made the password same in both the systems and it worked. Thanks many!!
    – jebina
    Commented Aug 21, 2012 at 13:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.