locked
Is Stored Procedure is Complied RRS feed

  • Question

  • Hi All,

     I Have Two basic Questions
    1.     Is Stored Procedure is Complied ? if Yes Than what is meaning of compilations in Sql Server?
    2.     Is View is  Complied?
    Thanks

    Handa
    Tuesday, January 5, 2010 4:23 AM

Answers


  • 1. Almost queries(including adhoc, proc, trigger, etc) are compiled
    2. Compiling has some process, parsing, resolving, optimizing, etc...
    3. (General) View(and Derived Talble, Inline Table-valued Function) is a  something alias(or macro) of the query.
       The query embedded  view is actually compiled

    I hope that helps
    Thanks


    Best Regards,
    Jungsun Kim
    Tuesday, January 5, 2010 5:05 AM
  • Hello Ritesh,

    When ever we execute query Optimizer create a querie plan for the execution. But for the Store procedure that execution plan is get stored on the procedure cache at the first time of execution. Thus while sp are faster because of pre compiled. About view its just a metadata form of base table. If you create index then it perform like a table.

    Thanks
    RM Thirunavukkarasu
    Tuesday, January 5, 2010 6:36 AM

All replies


  • 1. Almost queries(including adhoc, proc, trigger, etc) are compiled
    2. Compiling has some process, parsing, resolving, optimizing, etc...
    3. (General) View(and Derived Talble, Inline Table-valued Function) is a  something alias(or macro) of the query.
       The query embedded  view is actually compiled

    I hope that helps
    Thanks


    Best Regards,
    Jungsun Kim
    Tuesday, January 5, 2010 5:05 AM
  • Hello Ritesh,

    When ever we execute query Optimizer create a querie plan for the execution. But for the Store procedure that execution plan is get stored on the procedure cache at the first time of execution. Thus while sp are faster because of pre compiled. About view its just a metadata form of base table. If you create index then it perform like a table.

    Thanks
    RM Thirunavukkarasu
    Tuesday, January 5, 2010 6:36 AM