-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Description
For example, when "GO" is within multi-line comments.
I would do a PR but I have been hacking away at the code and it's all a bit messy ATM. However the following seems to work if called from the top of the DBHelper.ExecuteMigration method:
private string RemoveSqlComments(string commandText)
{
// Remove all comments, mainly because GO might be in the comments and since we split
// on that it can cause problems. The regular expression used below is from:
// http://stackoverflow.com/questions/7690380/regular-expression-to-match-all-comments-in-a-t-sql-script
Regex commentRegex = new Regex("(--.*)|(((/\\*)+?[\\w\\W]+?(\\*/)+))", RegexOptions.CultureInvariant);
return commentRegex.Replace(commandText, "");
}Metadata
Metadata
Assignees
Labels
No labels