diff -pruN django/django/core/management/sql.py django-sperry/django/core/management/sql.py
--- django/django/core/management/sql.py	2007-11-30 18:48:31.000000000 -0800
+++ django-sperry/django/core/management/sql.py	2007-11-30 18:54:37.000000000 -0800
@@ -422,6 +422,29 @@ def many_to_many_sql_for_model(model, st
 
     return final_output
 
+def _split_statements(value):
+    result = []
+    tmp = []
+    in_quotes = None
+
+    for line in value.split('\n'):
+        for c in line:
+            if c == ';' and not in_quotes:
+                result.append(u''.join(tmp))
+                tmp = []
+                continue
+
+            if c in ("'", '"'):
+                if not in_quotes:
+                    in_quotes = c
+                elif in_quotes == c:
+                    in_quotes = None
+            tmp.append(c)
+        result.append(u''.join(tmp))
+        tmp = []
+
+    return result
+
 def custom_sql_for_model(model):
     from django.db import models
     from django.conf import settings
@@ -430,23 +453,27 @@ def custom_sql_for_model(model):
     app_dir = os.path.normpath(os.path.join(os.path.dirname(models.get_app(model._meta.app_label).__file__), 'sql'))
     output = []
 
-    # Some backends can't execute more than one SQL statement at a time,
-    # so split into separate statements.
-    statements = re.compile(r";[ \t]*$", re.M)
-
     # Find custom SQL, if it's available.
     sql_files = [os.path.join(app_dir, "%s.%s.sql" % (opts.object_name.lower(), settings.DATABASE_ENGINE)),
                  os.path.join(app_dir, "%s.sql" % opts.object_name.lower())]
+
     for sql_file in sql_files:
         if os.path.exists(sql_file):
             fp = open(sql_file, 'U')
-            for statement in statements.split(fp.read().decode(settings.FILE_CHARSET)):
-                # Remove any comments from the file
-                statement = re.sub(ur"--.*[\n\Z]", "", statement)
-                if statement.strip():
-                    output.append(statement + u";")
+            sql_data = fp.read().decode(settings.FILE_CHARSET)
             fp.close()
 
+            # Some backends can't execute more than one SQL statement
+            # at a time, so split into separate statements.
+            for statement in _split_statements(sql_data):
+                statement = statement.strip()
+                if statement:
+                    # Remove any comments from sql
+                    if statement.startswith(u'--'):
+                        continue
+
+                    output.append(statement + u";")
+
     return output
 
 def sql_indexes_for_model(model, style):
diff -pruN django/tests/regressiontests/initial_sql_regress/models.py django-sperry/tests/regressiontests/initial_sql_regress/models.py
--- django/tests/regressiontests/initial_sql_regress/models.py	2007-11-30 18:48:31.000000000 -0800
+++ django-sperry/tests/regressiontests/initial_sql_regress/models.py	2007-11-30 18:54:37.000000000 -0800
@@ -7,7 +7,10 @@ from django.db import models
 class Simple(models.Model):
     name = models.CharField(max_length = 50)
 
-__test__ = {'API_TESTS':""}
+__test__ = {'API_TESTS': """
+>>> [ obj.name for obj in Simple.objects.all() ]
+[u'Mary', u'Anne', u'Ginger', u'Mrs. Mae', u'Capt. Bob', u'-- Comment Man', u'John', u'Paul', u'Ringo', u'George', u"Miles O'Brien", u'Semicolon;Man', u'This line has a Windows line ending']
+"""}
 
 # NOTE: The format of the included SQL file for this test suite is important.
 # It must end with a trailing newline in order to test the fix for #2161.
diff -pruN django/tests/regressiontests/initial_sql_regress/sql/simple.sql django-sperry/tests/regressiontests/initial_sql_regress/sql/simple.sql
--- django/tests/regressiontests/initial_sql_regress/sql/simple.sql	2007-11-30 18:50:49.000000000 -0800
+++ django-sperry/tests/regressiontests/initial_sql_regress/sql/simple.sql	2007-11-30 18:54:37.000000000 -0800
@@ -1,3 +1,7 @@
+INSERT INTO initial_sql_regress_simple (name) VALUES ('Mary'); INSERT INTO initial_sql_regress_simple (name) VALUES ('Anne'); INSERT INTO initial_sql_regress_simple (name) VALUES ('Ginger'); INSERT INTO initial_sql_regress_simple (name) VALUES ('Mrs. Mae');
+-- a comment
+INSERT INTO initial_sql_regress_simple (name) VALUES ('Capt. Bob'); -- another one
+INSERT INTO initial_sql_regress_simple (name) VALUES ('-- Comment Man');
 INSERT INTO initial_sql_regress_simple (name) VALUES ('John');
 INSERT INTO initial_sql_regress_simple (name) VALUES ('Paul');
 INSERT INTO initial_sql_regress_simple (name) VALUES ('Ringo');
diff -pruN django/tests/regressiontests/initial_sql_regress/tests.py django-sperry/tests/regressiontests/initial_sql_regress/tests.py
--- django/tests/regressiontests/initial_sql_regress/tests.py	1969-12-31 16:00:00.000000000 -0800
+++ django-sperry/tests/regressiontests/initial_sql_regress/tests.py	2007-11-30 18:56:41.000000000 -0800
@@ -0,0 +1,14 @@
+import unittest
+from django.core import management
+
+from models import Simple
+
+class CustomSqlForModel(unittest.TestCase):
+    def setUp(self):
+        self.output = management.sql.custom_sql_for_model(Simple)
+        
+    def test_multiline(self):
+        self.assertEqual(len(self.output), 13)
+
+if __name__ == '__main__':
+    unittest.main()
