Playing with "GO"

  • CREATE PROC GO @GO int=NULL AS SELECT @GO

    GO

    GO;

    GO 3

    GO

    EXECUTE('GO 1')

    GO 3

    GO

    DROP PROC GO

    GO

    can anybody explain it line by line ....how it get executed ?

    -------Bhuvnesh----------
    I work only to learn Sql Server...though my company pays me for getting their stuff done;-)

  • This was already explained in the discussion attached to this question. Please go there.

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • Heh... yeah... GO for it! 😛

    No explanation should be necessary... try executing parts of it yourself... lookup GO in Books Online to see what its correct and only format is. Is GO; a GO command or the name of a stored procedure? Figure it out...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

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

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