Find Jobs
Hire Freelancers

Batch Updates for Large Data in C#

$100-500 USD

Cancelled
Posted almost 17 years ago

$100-500 USD

Paid on delivery
Okay, I need some help. I can't seem to find the absolute correct and standard way to accomplish this. So, I need to turn to the experts :). I have a datatable, lets call it documents. It has 3 fields: docid (pkey, identity, increments) url (string, should be unique) body (string) I am using sql server 2005 and .net 2.0 (c#). I need to know 2 things. 1) How can I tell sql server, that the url field should be unique, and that someone attempts to put 2 of the same url into the db, an error should be thrown? 2) How can I do large batch updates to avoid trips to the db? Right now, I have an external source (spider) providing urls, and bodies for the table. I also have a very fast cache of hashes of the urls and ids. So I can very quickly check if a url needs to be updated or inserted by checking this cache. The spider gives me a collection of objects, which are essentially url, body pairs. I then check to see which urls do not exist, using the cache, and insert these urls using sqlbulkcopy. sqlbulkcopy is mega fast! Next I gather the urls that do exist, (using the cache), currently I use the attached algorithm to populate a DataTable and try to update the datasource with this table. But I get an error saying that rows marked with new must use an insert command, so I believe I'm doing something wrong. The message is: {"Update requires a valid InsertCommand when passed DataRow collection with new rows."} So the question is: How can I do a faster/easier batch update when the is external to sql server? ## Deliverables 1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. 2) Deliverables must be in ready-to-run condition, as follows (depending on the nature of the deliverables): a) For web sites or other server-side deliverables intended to only ever exist in one place in the Buyer's environment--Deliverables must be installed by the Seller in ready-to-run condition in the Buyer's environment. b) For all others including desktop software or software the buyer intends to distribute: A software installation package that will install the software in ready-to-run condition on the platform(s) specified in this bid request. 3) All deliverables will be considered "work made for hire" under U.S. Copyright law. Buyer will receive exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement). ## Platform .net 2.0 sql server 2005
Project ID: 2975951

About the project

5 proposals
Remote project
Active 17 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
5 freelancers are bidding on average $119 USD for this job
User Avatar
See private message.
$148.75 USD in 2 days
5.0 (129 reviews)
7.8
7.8
User Avatar
See private message.
$85 USD in 2 days
5.0 (14 reviews)
5.7
5.7
User Avatar
See private message.
$148.75 USD in 2 days
4.6 (32 reviews)
4.9
4.9
User Avatar
See private message.
$85 USD in 2 days
4.5 (4 reviews)
2.8
2.8
User Avatar
See private message.
$127.50 USD in 2 days
0.0 (0 reviews)
0.0
0.0

About the client

Flag of UNITED STATES
Omaha, United States
5.0
44
Payment method verified
Member since Jun 1, 2006

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.