Speed variance between executing procedure vs excuting t-sql standalone

  • Hi

    I have a strange scenario whereby if I execute a stored procedure it runs for about 2 minutes. If I run the contents of the stored procedure as standalone t-sql with the same parameters it run's in 50 seconds.

    How is this possible?

    Cheers

  • Did you check the execution plans? It is most probably different.

    -Roy

  • There are several reasons for this, a couple I've encountered are - differences in SET options and compiling the proc with set ansi nulls or quoted identifier OFF.

    [font="Comic Sans MS"]The GrumpyOldDBA[/font]
    www.grumpyolddba.co.uk
    http://sqlblogcasts.com/blogs/grumpyolddba/

Viewing 3 posts - 1 through 2 (of 2 total)

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