Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. SqlDateTime overflow. - Only on one computer out of 5 running the same code

SqlDateTime overflow. - Only on one computer out of 5 running the same code

Scheduled Pinned Locked Moved Database
helpcsharpdatabaseregexperformance
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Marcus J Smith
    wrote on last edited by
    #1

    I have a program that uses SqlBulkCopy to insert data into a staging table for processing. 5 different computers run the same .NET and database code and only one or a couple occasionally will receive the following error: "SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM." The exact same data will import correctly for other users as well as myself. There are only valid dates in the fields and I verified that their local database tables match the column order I am expecting. The only thing I can think of is that a memory issue is coming into play here and the data is corrupting internally before import. Is there something else I can look at? I dont understand why the same code has different results.


    CleaKO

    "Now, a man would have opened both gates, driven through and not bothered to close either gate." - Marc Clifton (The Lounge)

    M 1 Reply Last reply
    0
    • M Marcus J Smith

      I have a program that uses SqlBulkCopy to insert data into a staging table for processing. 5 different computers run the same .NET and database code and only one or a couple occasionally will receive the following error: "SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM." The exact same data will import correctly for other users as well as myself. There are only valid dates in the fields and I verified that their local database tables match the column order I am expecting. The only thing I can think of is that a memory issue is coming into play here and the data is corrupting internally before import. Is there something else I can look at? I dont understand why the same code has different results.


      CleaKO

      "Now, a man would have opened both gates, driven through and not bothered to close either gate." - Marc Clifton (The Lounge)

      M Offline
      M Offline
      Mycroft Holmes
      wrote on last edited by
      #2

      Bulk copy is fragile, what we do is ELT, Extract, Load then Transform, change all your staging fields to varchar, use bulk copy to shove the data into the table no matter what the format. Then use a stored proc to transform the data, you can control and manage a proc better than any load process. This same argument applies to SSIS, get the data in then clean it up. We have found this solution both robust and fast, IMHO transforms during load are a disaster.

      Never underestimate the power of human stupidity RAH

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups