Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Sql Server 2000 - Special characters - High Priority Expand / Collapse
Author
Message
Posted Wednesday, March 21, 2012 2:25 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, March 22, 2012 8:16 AM
Points: 2, Visits: 3
We are running SQL Server 2000 at multiple locations and we are trying to store english, spanish, and french words in the same database/table/column. Right now we have the columns at native character data type but it is still looking like it is not storing properly. I am not sure. How can we get around this issue?
Post #1270495
Posted Wednesday, March 21, 2012 2:42 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 1:09 PM
Points: 14,468, Visits: 38,066
all the code inserting the data has to use the same datatype : NVARCHAR or NCHAR.
code as simple looking as
try this code example out and see what happens if you mix varchar and nvarchar implicit conversion into the mix:
declare @var varchar(10),
@nvar nvarchar(10)
SELECT @var = '汉字/漢字' ,@nvar = '汉字/漢字'
SELECT @var,@nvar
SELECT @var = N'汉字/漢字' ,@nvar = N'汉字/漢字'
SELECT @var,@nvar



Lowell

--
help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!
Post #1270503
Posted Thursday, March 22, 2012 7:45 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, March 22, 2012 8:16 AM
Points: 2, Visits: 3
ok. thanks. I have another question, we are using bulk insert to load data from csv into sql server. when loading the special characters are lost? Do you know what would be causing the issue?
Post #1270855
Posted Thursday, March 22, 2012 8:01 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 1:09 PM
Points: 14,468, Visits: 38,066
take a look at this books online item about using native mode to avoid dataconversions...it's just a -N flag, but it's important to understand, it might be what is affecting your data, if the destination columns are NVARCHAR/NCHAR:


http://msdn.microsoft.com/en-us/library/ms189941.aspx


Lowell

--
help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!
Post #1270870
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse