March 12, 2015 at 4:20 am
Hi,
In SQL 2005 if i was trying to insert some data with a text qualifier inside a text qualified field, it would work, for example:
"Name","ID ","Location","","Comany",""House Name" Road",
In SQL 2012, this fails with the error message, cannot find the text qualifer for field.
To get around this, we are having to import the data into a Dirty Data column of aTEMP table, ID, Dirty Data, Clean data - perform multiple updates and change the text qualifier and ensure they are only changed in the right places so we can keep the ". In this example, we changed the text qualifier to PIPES.
After these updates, we then export the data from CLEAN data back out to CSV, then reimport it into the origional destination table with a new text qualifer.
There has to be an easier way to do this??
March 13, 2015 at 2:49 pm
Hello,
Do you mean you are getting an error when trying to include the exact string ' "House Name" '? (Added single quotes to emphasize that the exact string is "House Name" including the double quotes.)
- webrunner
-------------------
A SQL query walks into a bar and sees two tables. He walks up to them and asks, "Can I join you?"
Ref.: http://tkyte.blogspot.com/2009/02/sql-joke.html
March 13, 2015 at 2:58 pm
If you're actually expecting data with " in it can you change the file format from say comma delimited with " qualifiers to something else like just | delimited?
March 14, 2015 at 11:54 am
SQLAssAS (3/12/2015)
Hi,In SQL 2005 if i was trying to insert some data with a text qualifier inside a text qualified field, it would work, for example:
"Name","ID ","Location","","Comany",""House Name" Road",
In SQL 2012, this fails with the error message, cannot find the text qualifer for field.
To get around this, we are having to import the data into a Dirty Data column of aTEMP table, ID, Dirty Data, Clean data - perform multiple updates and change the text qualifier and ensure they are only changed in the right places so we can keep the ". In this example, we changed the text qualifier to PIPES.
After these updates, we then export the data from CLEAN data back out to CSV, then reimport it into the origional destination table with a new text qualifer.
There has to be an easier way to do this??
You mention the word "import". Where does the original data "live". In a file or in a table? Also, what tool (SSIS, BCP, Bulk Insert, or ????) are you trying to use to import the data?
--Jeff Moden
Change is inevitable... Change for the better is not.
March 19, 2015 at 8:06 am
ZZartin (3/13/2015)
If you're actually expecting data with " in it can you change the file format from say comma delimited with " qualifiers to something else like just | delimited?
If everything was pipe i would be a lot happier trust me. But we don't have much of a choice. To change to pipe we would have to do it our selves with the same approach of importing, updates particular sequences of " to | , exporting back out and importing back in :/
March 19, 2015 at 8:07 am
SQLAssAS (3/19/2015)
ZZartin (3/13/2015)
If you're actually expecting data with " in it can you change the file format from say comma delimited with " qualifiers to something else like just | delimited?If everything was pipe i would be a lot happier trust me. But we don't have much of a choice. To change to pipe we would have to do it our selves with the same approach of importing, updates particular sequences of " to | , exporting back out and importing back in :/
Hi Jeff, its a CSV file and we are using SSIS to import.
Viewing 6 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply