Difference B/W EXEC and only SP Name execution.

  • Hi,

       Can any one tell me what is the difference between execution of the below?

         EXEC <SP Name>  And     <SP Name>

     

    Thanks,

    Aregaddan.

     

     

     

         

  • <SP Name> is a shortcut that works if it is the only line in a t-sql batch.

    EXEC <SP Name> is required when there are multiple lines in the batch.

    For a single-line procedure call, there is no difference between the two.

    Eddie Wuerch
    MCM: SQL

  • Is it so hard to open BOL?

    EXECUTE

    Executes a scalar-valued, user-defined function, a system procedure, a user-defined stored procedure, or an extended stored procedure. Also supports the execution of a character string within a Transact-SQL batch.

    You do not have to specify the EXECUTE keyword when executing stored procedures if the statement is the first one in a batch.

     

    _____________
    Code for TallyGenerator

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

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