![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
With a SQL Server back end, using the same method is slow because the data is actually sent from Access to SQL Server one row at a time. I know that there are several methods of inserting the data from Access to SQL Server, without using DTS/SSIS? |
#3
| |||
| |||
|
|
"agiamb" <NOSPAMagiamb (AT) newsgroup (DOT) nospam> wrote in news:i5dss0$ens$1 (AT) news (DOT) eternal-september.org: With a SQL Server back end, using the same method is slow because the data is actually sent from Access to SQL Server one row at a time. I know that there are several methods of inserting the data from Access to SQL Server, without using DTS/SSIS? One method might be to use a passthrough and use the IN clause in the FROM like this: INSERT INTO ... SELECT ... FROM tblSource IN '\\Server\PathToDatabase\TempTable.mdb' Note that you can't use a file on the C: drive of your local computer because it will not be accessible to the SQL Server (unless you share it, of course), so as above, you'd want to do your import from a temp database stored on a server that is accessible to the SQL Server. There may be some variations on the SQL Server vocabulary for this, though. I'm only familiar with doing it in plain old Access. -- David W. Fenton http://www.dfenton.com/ contact via website only http://www.dfenton.com/DFA/ |
#4
| |||
| |||
|
|
Nice idea, I could create a temp accdb on the server and name it with the user's name for isolation, link it to my app, do the initial import into that, massage the data with user input, then do the import right from SQL Server. There is a stored procedure that runs after the transfer to SQL, so I can just add the import to that. |
#5
| |||
| |||
|
|
"agiamb" <NOSPAMagiamb (AT) newsgroup (DOT) nospam> wrote in news:i5ek1q$nrk$1 (AT) news (DOT) eternal-september.org: Nice idea, I could create a temp accdb on the server and name it with the user's name for isolation, link it to my app, do the initial import into that, massage the data with user input, then do the import right from SQL Server. There is a stored procedure that runs after the transfer to SQL, so I can just add the import to that. You'll probably need a full connect string (I'd suggest OLEDB), unless you permanently use "link server" to mount the temp files for use in the SQL Server. -- David W. Fenton http://www.dfenton.com/ contact via website only http://www.dfenton.com/DFA/ |
#6
| |||
| |||
|
|
My application uses ODBC connected tables to SQL Server 2008 R2 Express as the back end, across a LAN. One function is to import data from Excel files on the local machine, perform some manipulation on the imported data and add some user input. With an Access back end, I typically would *import the Excel data into a temporary local table, do the processing, then use an append query to insert it into the live back end table. With a SQL Server back end, using the same method is slow because the data is actually sent from Access to SQL Server one row at a time. I know that there are several methods of inserting the data from Access to SQL Server, without using DTS/SSIS? Can anyone tell me which is the fastest? -- AG Email: npATadhdataDOTcom |
#7
| |||
| |||
|
|
My application uses ODBC connected tables to SQL Server 2008 R2 Express as the back end, across a LAN. One function is to import data from Excel files on the local machine, perform some manipulation on the imported data and add some user input. With an Access back end, I typically would import the Excel data into a temporary local table, do the processing, then use an append query to insert it into the live back end table. With a SQL Server back end, using the same method is slow because the data is actually sent from Access to SQL Server one row at a time. I know that there are several methods of inserting the data from Access to SQL Server, without using DTS/SSIS? Can anyone tell me which is the fastest? -- AG Email: npATadhdataDOTcom |
#8
| |||
| |||
|
|
My application uses ODBC connected tables to SQL Server 2008 R2 Express as the back end, across a LAN. One function is to import data from Excel files on the local machine, perform some manipulation on the imported data and add some user input. With an Access back end, I typically would *import the Excel data into a temporary local table, do the processing, then use an append query to insert it into the live back end table. With a SQL Server back end, using the same method is slow because the data is actually sent from Access to SQL Server one row at a time. I know that there are several methods of inserting the data from Access to SQL Server, without using DTS/SSIS? Can anyone tell me which is the fastest? |
#9
| ||||
| ||||
|
|
On Aug 29, 10:03*am, "agiamb" <NOSPAMagi... (AT) newsgroup (DOT) nospam wrote: My application uses ODBC connected tables to SQL Server 2008 R2 Express a s the back end, across a LAN. One function is to import data from Excel files on the local machine, perform some manipulation on the imported data and add some user input. With an Access back end, I typically would *import the Excel data into a temporary local table, do the processing, then use an append query to ins ert it into the live back end table. With a SQL Server back end, using the same method is slow because the dat a is actually sent from Access to SQL Server one row at a time. I know that there are several methods of inserting the data from Access t o SQL Server, without using DTS/SSIS? Can anyone tell me which is the fastest? I'm not sure what you mean by "the data is sent from Access to the SQL Server one row at a time". |
|
That's the way *all* imports are done, depending upon how close you want to look at how SQL Server processes items. A "bulk" insert (INSERT * INTO MyTable type operation in Access) is another "fast" way to do things. |
|
If the data manipulation you're doing can be automated, you may want to upload to a "import" table and have a SQL Stored procedure do the manipulations, the imports, and the clearing of the table after it's done. That can often (but not always) faster then doing it in Access or VBA. (Of course, that statement depends upon how good a coder your DBA and your Access programmer are!) |
|
You may also want to consider upgrading from the free "Express" version to one of the more "robust" versions of MS SQL Server. There are *lots* of advantages to the upgrades, beyond just DTS/SSIS.... |
#10
| |||
| |||
|
|
Chuck Grimsby <cgatgoo (AT) gmail (DOT) com> wrote in news:87dfa311-b81a-4717-8562-7471b49b6a3d (AT) f6g2000yqa (DOT) googlegroups.com : On Aug 29, 10:03 am, "agiamb" <NOSPAMagi... (AT) newsgroup (DOT) nospam wrote: My application uses ODBC connected tables to SQL Server 2008 R2 Express a s the back end, across a LAN. One function is to import data from Excel files on the local machine, perform some manipulation on the imported data and add some user input. With an Access back end, I typically would import the Excel data into a temporary local table, do the processing, then use an append query to ins ert it into the live back end table. With a SQL Server back end, using the same method is slow because the dat a is actually sent from Access to SQL Server one row at a time. I know that there are several methods of inserting the data from Access t o SQL Server, without using DTS/SSIS? Can anyone tell me which is the fastest? I'm not sure what you mean by "the data is sent from Access to the SQL Server one row at a time". I think what he means is that instead of a single SQL INSERT being executed, Jet "optimizes" the operation so that there's a SQL INSERT to the SQL Server for every row of the source table. Jet is being very careful and cautious to be a "good citizen" among the users of the SQL Server, as this allows the server to serialize and prioritize the data of all users, so that a bulk insert doesn't tie up the server so that nobody can use it. It's almost always completely unwarranted, so we always have to work around it in a way that bypasses Jet's "optimization." That's the way *all* imports are done, depending upon how close you want to look at how SQL Server processes items. A "bulk" insert (INSERT * INTO MyTable type operation in Access) is another "fast" way to do things. With ODBC linked tables, what the SQL Server gets from Jet is one INSERT for every row. Turn on SQL Profiler and watch. If the data manipulation you're doing can be automated, you may want to upload to a "import" table and have a SQL Stored procedure do the manipulations, the imports, and the clearing of the table after it's done. That can often (but not always) faster then doing it in Access or VBA. (Of course, that statement depends upon how good a coder your DBA and your Access programmer are!) How does "upload to an 'import' table" bypass Jet's "optimization" of a bulk INSERT into single-row inserts? You may also want to consider upgrading from the free "Express" version to one of the more "robust" versions of MS SQL Server. There are *lots* of advantages to the upgrades, beyond just DTS/SSIS.... Specifically? I can't see any, myself. And isn't DTS deprecated? -- David W. Fenton http://www.dfenton.com/ contact via website only http://www.dfenton.com/DFA/ |
![]() |
| Thread Tools | |
| Display Modes | |
| |