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. SQL Import Wizard data types dont match

SQL Import Wizard data types dont match

Scheduled Pinned Locked Moved Database
databaseregexhelpquestion
3 Posts 3 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.
  • H Offline
    H Offline
    Hunter Barrington
    wrote on last edited by
    #1

    While importing data from a text file using the wizard i get the error

    Invalid character value for cast specification

    There's a bad record in the file... but the file is huge so it's nearly impossible to find it by hand. Is there a way to import the data and ignore records that are malformed or the data isn't in the data type it should be? TIA

    D M 2 Replies Last reply
    0
    • H Hunter Barrington

      While importing data from a text file using the wizard i get the error

      Invalid character value for cast specification

      There's a bad record in the file... but the file is huge so it's nearly impossible to find it by hand. Is there a way to import the data and ignore records that are malformed or the data isn't in the data type it should be? TIA

      D Offline
      D Offline
      DerekFL
      wrote on last edited by
      #2

      With SQL Server SSIS add a data transformation task and add a datasource (where the bad data is) and a destination (scrubbed data). drag green arrow from source to destination. Add a second destination and set on failure of first destination to redirect to second (red arrow). You can use a flat file if you want.

      1 Reply Last reply
      0
      • H Hunter Barrington

        While importing data from a text file using the wizard i get the error

        Invalid character value for cast specification

        There's a bad record in the file... but the file is huge so it's nearly impossible to find it by hand. Is there a way to import the data and ignore records that are malformed or the data isn't in the data type it should be? TIA

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

        I NEVER use transforms in the ETL layer. I load the data in a table using large varchar fields and use a procedure to do the transforms. This maybe (is) old fashioned but I find I have much better control over the data using a procedure. I can manage the exceptions more to my liking and the bloody thing doesn't break in the middle of the load. One reason I dislike SSIS and hate Biztalk is the complexity they instill into a basically simple operation.

        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