Speed of Updating Descriptions


Author
Message
Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)
Group: StrataFrame Users
Posts: 430, Visits: 507
I have a Sql Server table which I am updating from  VFP Tables. It curently has c 200,000 records and is taking about 2 hours to update.

The Sql table consists of about 20 fields from a VFP table, and an additional 10 fields, whcih are in effect lookup fiuelds to give descriptions from a series of VFP lookup tables.If I strip out the 'Lookup Code' bit, the update takes about 5 minutes, so I am fairly sure the bottleneck is in the way I am updating the descriptions, and womder if there is a quicker way to do this update.

I have the following code replicated 10 times for each of my lookup fields, within my main loop to update the main data

1. I set up an OleDbCommand with the connection string and a parameter for the lookup table

2. I then have a While Rdr.read loop to update a field with the description

Is there a quicker/better way to update these descripotions ?

Reply
Dustin Taylor
Dustin Taylor
StrataFrame Team Member (938 reputation)
Group: StrataFrame Users
Posts: 364, Visits: 771
Glad you got it working! A dictionary would indeed be a good approach for speed, assuming your lookup codes don't bloat too terribly much. For what it is worth, we have similar requirements on our automated conversion program (converts all the VFP data in our medical app to the appropriate SQL data/structures) and for that application we used SQL bulk copies as Edhy mentioned to get the data into SQL, then we play with it from there. 

I wasn't invovled with the development of that conversion program, so I couldn't tell you why they opted for bulk copies over SSIS, but SSIS is something I do need to become more familiar with regardless.  I've used it several times for one-time deals, and have been impressed with the speed and cabailities. I haven't ever followed all the way through to make a re-usable package, so thanks for reminding me to take a look, Charles Smile.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search