Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2001
    Location
    Canada
    Posts
    45

    Post Unanswered: sp_executesql vs execute ??

    Does someone can explain to me the difference between sp_executesql and execute command?

    does they have a advantage to use one or the other?


    Thanks
    Franky
    FBoucheros@hotmail.com

  2. #2
    Join Date
    Jul 2003
    Location
    The Dark Planet
    Posts
    1,401

    Re: sp_executesql vs execute ??

    Originally posted by Franky
    Does someone can explain to me the difference between sp_executesql and execute command?

    does they have a advantage to use one or the other?


    Thanks
    From the Holy Book (SQL BOL)
    sp_executesql has the same behavior as EXECUTE with regard to batches, the scope of names, and database context. The Transact-SQL statement or batch in the sp_executesql stmt parameter is not compiled until the sp_executesql statement is executed. The contents of stmt are then compiled and executed as an execution plan separate from the execution plan of the batch that called sp_executesql.
    Get yourself a copy of the The Holy Book

    order has no physical Brett in The meaning of a Kaiser . -database data

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •