how to make bulk updates?
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: how to make bulk updates?

  1. #1
    Join Date
    Apr 2007
    Posts
    1

    how to make bulk updates?

    hi i am having more than 50k records in my table.
    I am having 100 values in an Excel sheet.
    I wants to update a column in my database table,
    with the values in excel.

    Eg:
    StudName --> column in SQL Table
    Name--> Column in excel sheet.

    How to do this?

    Thanks,
    Karthik

  2. #2
    Join Date
    Mar 2002
    Location
    NY, USA
    Posts
    12,097

    Re: how to make bulk updates?

    I would...

    1) Create a temp table in the SQL DB with the contents of the Excel sheet
    2) Execute a stored proc to perform the necessary updates.
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009
    In theory, there is no difference between theory and paractice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

  3. #3
    Join Date
    Oct 2003
    Location
    .NET2.0 / VS2005 Developer
    Posts
    7,104

    Re: how to make bulk updates?

    I would:

    1) Create an XML transform to turn excel XML into dataset XML
    1.1) read the resulting xml straight into a dataset
    2) Use a correctly configured tableadapter to send the rows to the database
    "it's a fax from your dog, Mr Dansworth. It looks like your cat" - Gary Larson...DW1: Data Walkthroughs 1.1...DW2: Data Walkthroughs 2.0...DDS: The DataSet Designer Surface...ANO: ADO.NET2 Orientation...DAN: Deeper ADO.NET...DNU...PQ

  4. #4
    Join Date
    Oct 2003
    Location
    .NET2.0 / VS2005 Developer
    Posts
    7,104

    Re: how to make bulk updates?

    step 1 might not be necessary; a generic dataset should be able to read Excel's xml if it is just a single column
    "it's a fax from your dog, Mr Dansworth. It looks like your cat" - Gary Larson...DW1: Data Walkthroughs 1.1...DW2: Data Walkthroughs 2.0...DDS: The DataSet Designer Surface...ANO: ADO.NET2 Orientation...DAN: Deeper ADO.NET...DNU...PQ

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center