I have a stored procedure in SQL Server 2005 that is very quick when executed in Management Studio when connected using Windows Authentication. The query processes a vast amount of data and takes approx 2 seconds.
However, when I open Management Studio but connected as a SQL Server login account instead and execute the same stored procedure it takes nearly 15 seconds to complete.
I am also seeing the same slow query execution when connecting and running the stored procedure from an ASP.net application running on the same machine as the database.
Does anyone know what the issue may be ?
I've tried using WITH RECOMPILE and SET ARITHABORT ON and OFF to no effect.
Thanks,
Chris