"Incorrect syntax near 'GO' "
The explanation stands in the fact that GO is not a SQL keyword. It's a batch separator used by client tools (like SSMS) to break the entire script up into batches.
The solutions may be to break up the script into batches, with a script like this:
private static List getCommands(string testDataSql)
{
string[] splitcommands = File.ReadAllText(testDataSql).Split(new string[]{"GO\r\n"}, StringSplitOptions.RemoveEmptyEntries);
List commandList = new List(splitcommands);
return commandList;
}
Nessun commento:
Posta un commento