December 18, 2017 at 9:56 am
bcp appears to be changing some high ascii values on import (eg 249 to 168). How can I control/prevent this behaviour?
December 18, 2017 at 10:00 am
Stephen Grimshaw - Monday, December 18, 2017 9:56 AMbcp appears to be changing some high ascii values on import (eg 249 to 168). How can I control/prevent this behaviour?
More information please!
π
December 18, 2017 at 10:18 am
2. input file attached
3. bcp command
bcp ascii_test in diuc.txt -c -T
4. Here's query on what arrives in the database
select seq,substring(string,seq,1),ascii(substring(string,seq,1))
from ascii_test, (select top 12 seq=row_number() over(order by crdate) from sysobjects) a
5. Here's the result
1 D 68
2 I 73
3 Β¨ 168
4 C 67
5 32
6 E 69
7 D 68
8 W 87
9 A 65
10 R 82
11 D 68
12 S 83
December 18, 2017 at 10:30 am
and the server/db/table collation?
π
What does this return?SELECT
char(249) AS FROM_CHAR
,char(168) AS TO_CHAR
;
December 18, 2017 at 10:44 am
FROM_CHAR TO_CHAR
ΓΉ Β¨
December 18, 2017 at 10:50 am
And the collation?
π
December 18, 2017 at 10:55 am
Thank you for your help on this.
Collation is Latin1_General_CI_AS
December 18, 2017 at 11:05 am
Stephen Grimshaw - Monday, December 18, 2017 10:18 AM1. Table
create table ascii_test(string varchar(15))2. input file attached
3. bcp command
bcp ascii_test in diuc.txt -c -T4. Here's query on what arrives in the database
select seq,substring(string,seq,1),ascii(substring(string,seq,1))
from ascii_test, (select top 12 seq=row_number() over(order by crdate) from sysobjects) a5. Here's the result
1 D 68
2 I 73
3 ¨ 168
4 C 67
5 32
6 E 69
7 D 68
8 W 87
9 A 65
10 R 82
11 D 68
12 S 83
???
December 18, 2017 at 11:07 am
Lynn Pettis - Monday, December 18, 2017 11:05 AMStephen Grimshaw - Monday, December 18, 2017 10:18 AM1. Table
create table ascii_test(string varchar(15))2. input file attached
3. bcp command
bcp ascii_test in diuc.txt -c -T4. Here's query on what arrives in the database
select seq,substring(string,seq,1),ascii(substring(string,seq,1))
from ascii_test, (select top 12 seq=row_number() over(order by crdate) from sysobjects) a5. Here's the result
1 D 68
2 I 73
3 ¨ 168
4 C 67
5 32
6 E 69
7 D 68
8 W 87
9 A 65
10 R 82
11 D 68
12 S 83???
1. Table
create table ascii_test(string varchar(15))
2. input file attached
3. bcp command
bcp ascii_test in diuc.txt -c -T
4. Here's query on what arrives in the database
select seq,substring(string,seq,1),ascii(substring(string,seq,1))
from ascii_test, (select top 12 seq=row_number() over(order by crdate) from sysobjects) a
5. Here's the result
1 D 68
2 I 73
3 ¨ 168
4 C 67
5 32
6 E 69
7 D 68
8 W 87
9 A 65
10 R 82
11 D 68
12 S 83
________________________________________________________________
you can lead a user to data....but you cannot make them think
and remember....every day is a school day
December 18, 2017 at 1:21 pm
Hmmm... what you may want to try is adding the following "switch" to the BCP command...
-C RAW
--Jeff Moden
Change is inevitable... Change for the better is not.
December 19, 2017 at 2:39 am
Thank you very much. That seems to do the trick.
Now that I have the hint where to look I'll read the right documentation!
December 19, 2017 at 6:31 am
Stephen Grimshaw - Tuesday, December 19, 2017 2:39 AMThank you very much. That seems to do the trick.
Now that I have the hint where to look I'll read the right documentation!
Awesome... thank you for the feedback, Stephen.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 12 posts - 1 through 11 (of 11 total)
You must be logged in to reply to this topic. Login to reply