• andy 61637 (10/1/2015)


    Is there a way to have SSMS generate a create script using ; instead of go ? My create script is huge, quite a lot of editing otherwise. thx.

    Be careful, those are not the same things.

    You're getting the errors because you've got statements that must be the only statement in the batch (like CREATE PROCEDURE) in a batch with other statements, and you've got CREATE statements for objects which exist at the time the batch starts.

    Changing the batch terminator to a ; (which is a row terminator in T-SQL, not an indication where to break batches of statements apart) is not a solution. You need to take your original code, with the GO, and break it up into multiple separate batches in whatever tool you're using. Each place SSMS puts a GO must indicate the end of one batch and the beginning of another separate batch of statements. Otherwise you're just going to get errors.

    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