Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Importing ASCII data into SQL database

Posted on 2014-01-08
5
Medium Priority
?
950 Views
Last Modified: 2014-01-28
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
Comment
Question by:Rupert Eghardt
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 1500 total points
ID: 39764973
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
 

Author Comment

by:Rupert Eghardt
ID: 39765070
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
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 39765081
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
 
LVL 28

Expert Comment

by:Ark
ID: 39781442
Are you speaking specially about single quotes? Just duplicate them. VB code:
correctString=ASCIIString.Replace("'","''")
0
 

Author Comment

by:Rupert Eghardt
ID: 39783511
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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Viewers will learn how the fundamental information of how to create a table.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question