import re
sql = """-- this is a great database script!  go team go!
INSERT INTO myTable(stringColumn) VALUES ('go away!')
/*
  here are some comments that go with this script.
*/
GO 5 --this is a test
INSERT INTO myTable(stringColumn) VALUES ('this is the next script')"""
statements = re.split('(?m)^\\s*GO\\s*(?:[0-9]+)?\\s*(?:--.*)?$', sql)
for statement in statements:
    pass
regex for parsing SQL statements