Sql-server – Query takes longer as domain user than local admin

sql server

I have an application that runs ad-hoc queries to a remote SQL server. I'm running into a bizarre problem with the application taking significantly longer to return results when the application is running as a user versus a local administration (to the workstation).

I launched my application normally, and then launched a separate instance by right clicking > run as administrator.

I started profiling the database. Using the exact same steps with the exact same query, the 'user' application takes 15 seconds to return data.
When I run the application 'as administrator' it takes only 3 seconds.

I can't find a reason why the same application using the same steps running the same queries is taking significantly longer to return results. I've run the test several times with similar discrepancies.

I can reproduce the issue using multiple workstation and multiple domain user accounts. Anytime the user runs the application 'as administrator' (invoking local admin), it runs much quicker.

Any insight would be helpful here, I'm completely stumped.

EDIT: The application authenticates to the database using SQL authentication in both cases (using the same credentials).

Best Answer

After a few hours and some pow-wow time with my developers, we discovered the issue:

I typically uncheck login\logoff auditing in SQL profiler, but it happened to be the window I needed to peek on the cause. When running 'as admin' the application connects using TCP\IP.

When running as just a user, the app connects over Named Pipes. I'll still need to work out why, but in the mean time I can force the app to run in TCP\IP using a different connection string.