Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1143
  • Last Modified:

Importing ASCII data into SQL database

Hi Guys,

I am importing an ASCII text file into a SQL database.
I have a problem with text-lines in the ASCII file containing special characters.

If a line of text contains a special character (for example in the name / surname) it effects the formatting of that line, and imports incorrectly into the SQL database.

I believe the problem is with the reading of the actual ASCII text file, and the column count.  The special characters seem to move the columns for that line, one or two characters forward.

Is there way of resolving this particular problem?
0
Rupert Eghardt
Asked:
Rupert Eghardt
  • 2
  • 2
1 Solution
 
Carl TawnSystems and Integration DeveloperCommented:
How are you importing the data? It sounds like you are dealing with Unicode data rather than pure ASCII - so it is more likely an issue with the import mechanism.
0
 
Rupert EghardtProgrammerAuthor Commented:
I developed a small import application in Clarion, which reads the ASCII file and writes the records into SQL.

Is there a way perhaps to re-save the ASCII file, to get rid of all the special characters?
0
 
Carl TawnSystems and Integration DeveloperCommented:
Do you not need to preserve the input data as it is? Can you modify your import routine to accept unicode instead? Unicode won't be a problem for SQL Server as long as you are storing it in a NCHAR or NVARCHAR.
0
 
ArkCommented:
Are you speaking specially about single quotes? Just duplicate them. VB code:
correctString=ASCIIString.Replace("'","''")
0
 
Rupert EghardtProgrammerAuthor Commented:
I am referring to all sorts of special characters, such as in Spanish, Italian, Russian, etc. surnames.

I think Carl is correct, I should change the import routing, but I don't think Clarion can read Unicode from ASCII, not sure though.

Thanks for the help, I will try to find a way in Clarion to read Unicode.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

A proven path to a career in data science

At Springboard, we know how to get you a job in data science. With Springboard’s Data Science Career Track, you’ll master data science  with a curriculum built by industry experts. You’ll work on real projects, and get 1-on-1 mentorship from a data scientist.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now