简单写个例子
遇到GO就清除,继续执行
var
sqlList:TstringList;
i:Integer;
begin
adoquery.close;
adoquery.sql.clear;
sqlList:=TstringList.create;
sqlList.loadfromfile('d:\hr.sql');
for i:=0 to sqlList.Count-1 do
begin
if lowcase(sqlList.String[i])<>'go' then
adoquery.sql.append(sqlList.String[i])
else
begin
adoquery.execsql;
adoquery.close;
adoquery.sql.clear;
end;
end;
end;