• You don't currently have to terminate statements with a semicolon. However, you will have to at an as-yet-undetermined future date.

    I don't know a tool that will automate adding them for you. Probably, once it's needed, someone (maybe RedGate) will create such a tool, but there's no market for it yet.

    As already mentioned, GO won't need one. It's not an SQL statement, it's an inline command for Management Studio (and for old Query Analyzer). You can actually put a number after GO to get it to run the preceeding batch X number of times. Like "GO 10" will run the batch 10 times. Not many seem to know that. Putting a semicolon after GO makes the compiler think you are trying to do an SQL command, and will throw an error.

    SET will need one, at whatever future date they become mandatory. So will BEGIN and END. (END makes sense to have one, but BEGIN doesn't. Not to me anyway.) There are some others that won't as well.

    Example:

    CREATE PROCEDURE dbo.MyProc

    AS

    SET NOCOUNT ON ;

    SELECT *

    FROM dbo.MyTable ;

    Note that the CREATE PROC <name> AS statement doesn't have a semicolon after it, but SET NOCOUNT ON and the SELECT statement do.

    None of that is needed, yet. But it will be soon, so it's a good idea to get in the habit now.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon