• With you there.  There's more to GO than meets the eye, and it doesn't even have to be "GO" either!

    Thort it might be fun to share this early tale of GO horror (I was a lot younger then):

    SQL 7, asked to implement a script from a (VB) developer to add a column to a table on a remote, client mission-critical, really, really, really important customer address db. 

    So, did I double-check the code?  No. 

    Did I test it on a local db?  No. 

    Can you see a disaster coming?  Oh, yes...

    Run the script.  See the script run.  See the error.

    Turns out VB Fly Boy had scripted the change from Enterprise Mangler and it went something like this:

    SELECT * INTO newtable FROM oldtable

    GO

    DROP TABLE oldtable

    GO

    CREATE TABLE oldtable (with shiny new column)

    GO

    INSERT oldtable SELECT * FROM newtable

    GO

    Okey-dokey, except the first SELECT INTO failed.  But, thanks to the joys of "GO" the script ploughed on, dropped the table etc.  So, ended up with the new table with its new column and no data!

    Oops.  Well, that'd be ok 'cos the local dba on the ground will have a back up.  Well, yes, from 3 months ago.

    Lots and lots of lessons learned there.  I now spend my days doing macrame.