calling sp in IF/BEGIN/END statement

  • do i have to put anything in front of a stored procedure in order to call it with the begin end statement.

    for example:

    if 1=1

    begin

    sp_test

    end

    is this sufficent or do i need to put something in front. i thought exec but it errors off.

  • you must execute it like this:

    if 1=1

    begin

    EXEC sp_test

    end

    Are you having errors executing it like this? If so, what error?

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

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