Re: MS SQL -> ACcess Data Export (Nearly 2 000 000)



For your method use server-side cursor - it is probable that you will not
have enough RAM to hold 2M rows in cache.

As alternative, connect to Access database and execute:

select * into jobs
from jobs
in [ODBC;Driver=SQL
Server;SERVER=<ServerName>;UID=<UserID>;PWD=<Password>;DATABASE=<Database>]

(there are no line breaks between [ and ]). Replace <...> with your values.

//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)


"SEDS" <saintfi@xxxxxxxxx> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ:
news:446ec9a9@xxxxxxxxxxxxxxxxxxxxxxxxx
Hello,
I have to export jobs from MSSQL server database to access database.
Nearly
2 000 000 datas have to be exported. This operation will be done over 100
MS
SQL Server. I am using Delphi 6. When I try to run the program it gives
"virtual memory not enough". error. Is there Any idea?

Thanks,

adoquery.SQL.Add('select * from jobs');
adoquery.open;
adoquery.First;
while not adoquery.Eof do begin
s01:=adoquery.Fields[0].AsString;
s02:=adoquery.Fields[1].AsString;
s03:=adoquery.Fields[2].AsString;
s04:=adoquery.Fields[3].AsString;
s05:=adoquery.Fields[4].AsString;
s06:=adoquery.Fields[5].AsString;
s07:=adoquery.Fields[6].AsString;
s08:=adoquery.Fields[7].AsString;
s09:=adoquery.Fields[8].AsString;
s10:=adoquery.Fields[9].AsString;
s11:=adoquery.Fields[10].AsString;
s12:=adoquery.Fields[11].AsString;
s13:=adoquery.Fields[12].AsString;
s14:=adoquery.Fields[13].AsString;
s15:=adoquery.Fields[14].AsString;
s16:=adoquery.Fields[15].AsString;
s17:=adoquery.Fields[16].AsString;
s18:=adoquery.Fields[17].AsString;
s19:=adoquery.Fields[18].AsString;
s20:=adoquery.Fields[19].AsString;
s21:=adoquery.Fields[20].AsString;
s22:=adoquery.Fields[21].AsString;
s23:=adoquery.Fields[22].AsString;
s24:=adoquery.Fields[23].AsString;
s25:=adoquery.Fields[24].AsString;
s26:=adoquery.Fields[25].AsString;
s27:=adoquery.Fields[26].AsString;
s28:=adoquery.Fields[27].AsString;
s29:=adoquery.Fields[28].AsString;
s30:=adoquery.Fields[29].AsString;

sql_i:='insert into jobs values(';
sql_i:=sql_i+#39+s01+#39+',';
sql_i:=sql_i+s02+',';
sql_i:=sql_i+#39+s03+#39+',';
sql_i:=sql_i+#39+s04+#39+',';
sql_i:=sql_i+#39+s05+#39+',';
sql_i:=sql_i+#39+s06+#39+',';
sql_i:=sql_i+#39+s07+#39+',';
sql_i:=sql_i+#39+s08+#39+',';
sql_i:=sql_i+#39+s09+#39+',';
sql_i:=sql_i+#39+s10+#39+',';
sql_i:=sql_i+#39+s11+#39+',';
sql_i:=sql_i+#39+s12+#39+',';
sql_i:=sql_i+#39+s13+#39+',';
sql_i:=sql_i+#39+s14+#39+',';
sql_i:=sql_i+#39+s15+#39+',';
sql_i:=sql_i+#39+s16+#39+',';
sql_i:=sql_i+#39+s17+#39+',';
sql_i:=sql_i+#39+s18+#39+',';
sql_i:=sql_i+#39+s19+#39+',';
sql_i:=sql_i+#39+s20+#39+',';
sql_i:=sql_i+#39+s21+#39+',';
sql_i:=sql_i+#39+s22+#39+',';
sql_i:=sql_i+#39+s23+#39+',';
sql_i:=sql_i+#39+s24+#39+',';
sql_i:=sql_i+#39+s25+#39+',';
sql_i:=sql_i+#39+s26+#39+',';
sql_i:=sql_i+#39+s27+#39+',';
sql_i:=sql_i+#39+s28+#39+',';
sql_i:=sql_i+s29+',';
sql_i:=sql_i+#39+s30+#39;
sql_i:=sql_i+')';

adocommand.CommandText:=sql_i;
adocommand.Execute;
adoquery.Next;
end;
//----------------------------------------------------
//**** *****************
//----------------------------------------------------

ADOQuery.Close();
ADOQuery.Free;
adocommand.Free;




.



Relevant Pages

  • Re: Move SQL Server to new hardware
    ... The machine name for your SQL Server agent jobs. ... Tibor Karaszi, SQL Server MVP ...
    (microsoft.public.sqlserver.server)
  • Re: How to do this?
    ... move the backend tables to the SQL Server and link the sql server tables in ... > typically one things of an Access database as either a relational database ... when you speak of splitting a frontend to an IIS ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Access database stability issues
    ... We have a front-end Access database file and the back-end Access database file with all the content. ... The back-end file is located on the server while the front-end is installed on 3 different computers in our office. ... Once we upgraded to SBS 2008, each client computer began experiencing occassional crashes due to the front-end losing its connection to the back-end file. ...
    (microsoft.public.windows.server.sbs)
  • Re: this combo: php in a windows2003 + msaccess in a samba unix sh
    ... SQL Server i have installed on the web server?, ... its to have a faster querying of the MS access database without ... compromising the performance of Our SQL Server database application. ... ODBC is much faster than any Access database I've seen. ...
    (microsoft.public.windows.server.networking)
  • Re: Limitations to How Many Users can use the same form at the same ti
    ... Created Form to populate information in an Access Database all at the same ... would use sql server. ... You can use ms-access with 300, or even 600 people all at the same time. ...
    (microsoft.public.access.forms)