Re: Copying Data from Access to SQL Server
- From: RoyVidar <roy_vidarNOSPAM@xxxxxxxx>
- Date: Mon, 03 Jul 2006 12:16:02 +0200
TC wrote in message <1151910110.281840.316230@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> :
I need an automated procedure to copy data from an Access table to a
SQL Server table. Speed is important. What is the recommended
technique?
I can export the data from Access, copy it via FTP, then import it into SQL Server. I've tried that, and the speed is acceptable. It is an ugly solution, however, and I expect to find a better one -- preferably a solution better integrated with the Access RDBMS.
I've tried using an ODBC connection and an INSERT query. That's a good, clean technique, but is extremely slow (about 10x slower than the file copy technique).
I've also tried using an OLEDB connection and ADO recordsets to copy
the data procedurally. That was even slower (about 30x slower than the file copy).
None of this makes sense to me. Why can't Access transfer data to SQL
Server through ODBC or OLEDB virtually as fast as the network can carry the data? There are no indexes or triggers involved, and no transaction processing -- just a simple column-for-column transfer of data from one table to another. I feel as though I must be missing something obvious. Can anyone offer any insight?
-TC
By the way, I'm using Access 2003 and SQL Server 2000. The network is a WAN and I'm using TCP/IP as the default protocol.
Have you tried Openrowset (whatch for linebreaks)?
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_oa-oz_78z8.asp
say a one field/one table thingie, create an SP
CREATE PROCEDURE dbo.uspCopyTable
AS
INSERT INTO
dbo.mytable (myfield)
SELECT
myfield
FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'c:\mypath\mydb.mdb';'admin';'mypwd', mytable)
GO
fire it off by something like this
dim cn as adodb.connection
set cn = new adodb.connection
cn.open "Provider=sqloledb;" & _
"Data Source=myServerName;" & _
"Initial Catalog=myDatabaseName;" & _
"Integrated Security=SSPI"
cn.execute "dbo.uspCopyTable"
--
Roy-Vidar
.
- References:
- Prev by Date: Re: 2GB size limit on Access2003/XP ?
- Next by Date: Re: Copying Data from Access to SQL Server
- Previous by thread: Re: Copying Data from Access to SQL Server
- Next by thread: Re: Copying Data from Access to SQL Server
- Index(es):
Relevant Pages
|
Loading