var
stm: TResourceStream;
buffer: string;
bp, ep: PChar;
begin
stm := TResourceStream.Create(Instance, 'SQLSCRIPT', RT_RCDATA);
setlength(buffer, stm.size);
stm.readbuffer(buffer[1], stm.size);
stm.free;
bp := pchar(buffer);
ep := bp;
repeat
ep := strscan(ep, #13);
if (ep<>nil) and (strlcomp(ep, #13#10'GO'#13#10, 6)=0) then
begin
adocommand1.commandtext := copy(string(bp), 1, integer(ep)-integer(bp));
adocommand1.execute;
inc(ep, 6);
bp := ep;
end else if ep <> nil then inc(ep);
until (ep=nil) or (integer(bp)-integer(buffer)>=length(buffer));
end;