Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Japanese characters as question marks


Japanese characters as question marks

Author
Message
sqldriver
sqldriver
Mr or Mrs. 500
Mr or Mrs. 500 (564 reputation)Mr or Mrs. 500 (564 reputation)Mr or Mrs. 500 (564 reputation)Mr or Mrs. 500 (564 reputation)Mr or Mrs. 500 (564 reputation)Mr or Mrs. 500 (564 reputation)Mr or Mrs. 500 (564 reputation)Mr or Mrs. 500 (564 reputation)

Group: General Forum Members
Points: 564 Visits: 2492
Absolutely. Here you go.

https://www.dropbox.com/s/sp6b6kf6z997g55/erikd.csv
Orlando Colamatteo
Orlando Colamatteo
SSCrazy Eights
SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)

Group: General Forum Members
Points: 8219 Visits: 14368
Where I have your workflow:

1. dbo.LoadPreLoadFromExcel brings the contents of the Excel into a new "load" table
2. dbo.CreateTargetTable creates a new "target" table with typed columns from data in sample_fields (this proc will not create tables with Unicode columns)
3. dbo.LoadTargetFromFile copies data from "load" table created into "target" table
4. dbo.CreateProcessTable creates a new "process" table
5. dbo.LoadProcessfromTarget copies data from "target" to "process" table

I am assuming you sent me the definition for the "process" table because it has NVARCHAR columns and dbo.CreateTargetTable does not know how to create NVARCHAR columns in the "target" table. I think your problem is in the creation of the "target" table, i.e. in step 2 above. Can you please send the table definitions for the "load", "target" and "process" tables for this project, scripted out of SSMS by right-clicking the each and selecting "Script Table As" > "Create" as opposed to a copy/paste from the grid?

__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
sqldriver
sqldriver
Mr or Mrs. 500
Mr or Mrs. 500 (564 reputation)Mr or Mrs. 500 (564 reputation)Mr or Mrs. 500 (564 reputation)Mr or Mrs. 500 (564 reputation)Mr or Mrs. 500 (564 reputation)Mr or Mrs. 500 (564 reputation)Mr or Mrs. 500 (564 reputation)Mr or Mrs. 500 (564 reputation)

Group: General Forum Members
Points: 564 Visits: 2492
Yeah, I sort of forgot to mention that I numbered them in the order I use them. Heh.

Here's the scripted output you asked for.

https://www.dropbox.com/s/inhtv19uyo04xyk/erikd_tables.zip

I've also included the full table create statement, along with _raw and _load, just in case.
Orlando Colamatteo
Orlando Colamatteo
SSCrazy Eights
SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)

Group: General Forum Members
Points: 8219 Visits: 14368
As suspected

[Prefix] [varchar](64) NULL,

in the "load" table is the best candidate for causing the issue. Should be NVARCHAR.

__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
sqldriver
sqldriver
Mr or Mrs. 500
Mr or Mrs. 500 (564 reputation)Mr or Mrs. 500 (564 reputation)Mr or Mrs. 500 (564 reputation)Mr or Mrs. 500 (564 reputation)Mr or Mrs. 500 (564 reputation)Mr or Mrs. 500 (564 reputation)Mr or Mrs. 500 (564 reputation)Mr or Mrs. 500 (564 reputation)

Group: General Forum Members
Points: 564 Visits: 2492
The other fields it's occurring in are first name, last name, and company name. Crud.
nick.mcdermaid
nick.mcdermaid
SSC-Enthusiastic
SSC-Enthusiastic (199 reputation)SSC-Enthusiastic (199 reputation)SSC-Enthusiastic (199 reputation)SSC-Enthusiastic (199 reputation)SSC-Enthusiastic (199 reputation)SSC-Enthusiastic (199 reputation)SSC-Enthusiastic (199 reputation)SSC-Enthusiastic (199 reputation)

Group: General Forum Members
Points: 199 Visits: 765
If I understand correctly, when looking at the same table with different clients, you can see the japanese characters in one, but not in the other? Doesn't that mean the data is in the table, but one client can't handle it properly, so it's a client issue?
sqldriver
sqldriver
Mr or Mrs. 500
Mr or Mrs. 500 (564 reputation)Mr or Mrs. 500 (564 reputation)Mr or Mrs. 500 (564 reputation)Mr or Mrs. 500 (564 reputation)Mr or Mrs. 500 (564 reputation)Mr or Mrs. 500 (564 reputation)Mr or Mrs. 500 (564 reputation)Mr or Mrs. 500 (564 reputation)

Group: General Forum Members
Points: 564 Visits: 2492
nick.mcdermaid (4/12/2013)
If I understand correctly, when looking at the same table with different clients, you can see the japanese characters in one, but not in the other? Doesn't that mean the data is in the table, but one client can't handle it properly, so it's a client issue?


Sort of, but not exactly. It was more an issue of the characters converting to question marks from one staging table to another (columns changing from nvarchar to varchar).

The 'correct' data shows as rectangles in SSMS 2005, and Kanji in 2008. So that part is client related.
Orlando Colamatteo
Orlando Colamatteo
SSCrazy Eights
SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)

Group: General Forum Members
Points: 8219 Visits: 14368
erikd (4/11/2013)
The other fields it's occurring in are first name, last name, and company name. Crud.

It should be a quick fix to the cursor declaration I showed above so those columns are generated as NVARCHAR.

__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
sqldriver
sqldriver
Mr or Mrs. 500
Mr or Mrs. 500 (564 reputation)Mr or Mrs. 500 (564 reputation)Mr or Mrs. 500 (564 reputation)Mr or Mrs. 500 (564 reputation)Mr or Mrs. 500 (564 reputation)Mr or Mrs. 500 (564 reputation)Mr or Mrs. 500 (564 reputation)Mr or Mrs. 500 (564 reputation)

Group: General Forum Members
Points: 564 Visits: 2492
opc.three (4/12/2013)
erikd (4/11/2013)
The other fields it's occurring in are first name, last name, and company name. Crud.

It should be a quick fix to the cursor declaration I showed above so those columns are generated as NVARCHAR.


You were dead on. I changed and tested the script, and everything works beautifully. Thank you for your time.

Are you aware of a way to write text files as Unicode? The 'default' seems to be ANSI.

Actually, I'm going to start a new thread for that, it's a distinct topic with its own stored procedure.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search