Hey All


Why is it that a select can take 180 seconds when run from the application but only 3.5 seconds when run from Query Analyzer.

Trace data (Cognos report net):
declare @P1 int
set @P1=6
exec sp_prepare @P1 output, NULL, N'select statement using an IN with over 500 values OPTION(FAST 1) ', 1
select @P1

exec sp_execute 6 (180000 on duration)

Trace data (Query Analyzer):
same stement as above: select statement using an IN with over 500 values OPTION(FAST 1) (3563 on duration)

Why the difference? Any ideas welcome.

Thanks
G