How to avoid this error when scripting multiple sp? Thanks.

  • I have multiple sp with @sql defined, when I script these sp, it throws error saying @spl already defined, well, true or false, in the final generated script, yes; but I want to re-generate all the sp in a new database, eventually there would be multiple sp generated and those @sql will fall into different sp and hence @sql is NOT already defined.

    How do I avoid this error?

    Thanks.

  • Use a batch separator (aka GO);-)

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • That's easy, isn't it? Thank you.

  • Use Go batch separator as Luis suggested...

    _______________________________________________________________
    To get quick answer follow this link:
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

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

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