View inside a Stored Procedure

  • Hi,

    When i use a view inside my stored procedure, it takes a longer time to execute. This view has a select statement from a different database. i.e., select columnname from [dbx].dbo.table1

    However, if i give the select statement directly instead of a view inside the stored proc, it executes faster than the former.

    Can anyone please let me know why?

    Thanks.

    C.Ganesh


    Regards,

    Ganesh

  • Google "parameter sniffing".

    And next time, post the procedure definition so that we don't have to guess what the problem might be.

    ML

    ---
    Matija Lah, SQL Server MVP
    http://milambda.blogspot.com

  • will do so in the future.

    thank you for the reply.


    Regards,

    Ganesh

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

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