为何提示 go 附近语法错误?
createdatabase.sql文件的内容为:
if db_id('test') is not null drop database test
go
create database test
---------------------------------------------------------------------
delphi里面的代码是:
procedure TCreateDbForm.Button1Click(Sender: TObject);
begin
createdatabase(extractfilepath(application.ExeName)+'createdatabase.sql');
end;
procedure TCreateDbForm.createdatabase(filepath:shortstring);
var
st:Tstringlist;
begin
st:=Tstringlist.Create;
st.LoadFromFile(filepath);
with adoquery1 do
begin
Close;
SQL.Clear;
SQL.AddStrings(st);
ExecSQL;
end;
st.Free;
end;
--------------------------------------------------
运行之后,提示:第一行 go 附近语法错误。
请问大家,哪里错了?