all groups > sql server programming > july 2004 >
You're in the

sql server programming

group:

MS Access to SQL


Re: MS Access to SQL Aaron [SQL Server MVP]
7/11/2004 10:38:29 PM
sql server programming:
Why not INSERT newtable SELECT stuff FROM oldtable? One of the great
features of a relational database is, typically, the ability to avoid
long-winded, row-by-row sequential processing.

However, we can't really tell you how to do that unless you provide more
information. What do your tables look like? What kind of data transfer are
you trying to perform? Can you show your schema, some sample data, and how
you want the data changed as an end result?

If your tables are already in SQL Server, see http://www.aspfaq.com/5006 for
details on giving us descriptions of your tables that we can work with.

--
http://www.aspfaq.com/
(Reverse address to reply.)




[quoted text, click to view]

MS Access to SQL Claudiney
7/11/2004 10:45:43 PM
Hi folks, I've been trying to transfer some ms access projects to SQL SERVER
2000 and I'm facing some challenges.
In ms access I have one vba code where I open one recordset with thousands
of records and loop until the EOF is found.
Each Item in the recordset is used as a paramter to insert data into one
table trhough a parameter query.
How can I open one recordset in SQL Server, get each Item and use it as a
parameter in a store procedure that will fill another table?
My goal is run all the code on server.
Thanks in advance.

Re: MS Access to SQL Claudiney Ribeiro
7/12/2004 4:33:10 AM

Thakn you guys by the answers.
I'll pay more attention next time.


*** Sent via Devdex http://www.devdex.com ***
Re: MS Access to SQL Andrew John
7/12/2004 3:50:04 PM
[quoted text, click to view]

Claudiney,

You can do this as written by using a cursor. This allows sequential
processing through a resultset. Check "declare cursor" in Books Online
for details / examples.

Cursors are not generally very performant, and religous objections
apart, it is worth the extra effort to process all the rows in parallel,
in a single insert, just for the speed and efficiency gains. ( Can be
orders of magnitude faster ).

If your 2nd procedure's processing is too complicated to replace with
a single query, then another possibility is using DTS, but thats often
uglier than a cursor.

If you want specifc help, then post more details as Aaron asks - Table
structures, the full text of the 2nd stored proc ...

Regards
AddThis Social Bookmark Button