Ideas for Implementation

  • 14 years ago

    Hi Everyone,
    I have been given a task from work, and am wondering if anyone here could provide me with some ideas for the implementation of this project.

    Basically, I have been given the task of catologing our website keywords. We are a major player in the travel industry, and could have anywhere upto 100,000+ keywords at any one time. We use google adsense to manage our keywords (for google only) and from the web based interface, I can download keyword groups as a csv file. I want to write a program, which can load a csv file and insert all keywords into a MS SQL database table. This in itself is simple enough, but over our different marketing campagins, some key words may be repeated. So upon the loading of subsequent csv files, I only wish to add new enteries to the database table. (i.e enteries that do no exist in any other marketing campagin)

    I am not an experienced database programmer, and I am not sure of any way to do this, apart from loop through the whole database table checking if a single keyword already exists, so if anyone has any other suggestions on how I can do this efficiently, I would be more than grateful.

    Regards

  • 14 years ago
    If you specify that your keyword column is unique and then perfrom a batch update using a DataAdapter, the default behaviour is for the update to fail if a value is inserted that already exists.  If you set the ContinueUpdateOnError property of your DataAdapter to True then rows containing existing values will simply be ignored and all the new values will be inserted successfully, assuming there are no other errors of course.  This means that you can simply insert everything without regard for whether it exists already or not.

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Computer science education cannot make anybody an expert programmer any more than studying brushes and pigment can make somebody an expert painter” - Eric Raymond