• n00bDBA (10/23/2012)


    Interesting, so when using dynamic sql you never put in GO? How is it ran then if you cant use GO to separate statements?

    Each piece you EXEC is a separate batch

    I thought some things needed GO like reconfigure (going out of scope i know just interested to learn 🙂 )

    Nothing needs GO (well, in SSMS anyway). Some things have to be run in their own batch (create proc), but that doesn't mean you need GO, just that it has to be a single batch.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass