Using Chinese characters in SQL Server stored procedure -
i have stored procedure called ssis package. package calls many stored procedures, particular 1 1 causing issues. basically, converting column in table nchar
nvarchar
, putting values table.
the values english, or chinese.
here code:
set ansi_nulls on go set quoted_identifier on go alter procedure [dbo].[transformcustomer] declare @mapdimcustomer table ( sourcesystemid int, excustomerkey nvarchar(15), customername nvarchar(115), customertypename nvarchar(50) ) insert @mapdimcustomer (sourcesystemid, excustomerkey, customername, customertypename) select 4 sourcesystemid, c.aban8 excustomerkey, c.abalph customername, c.abat1 customertypename f0101 c left join globaldw.stage.dimcustomer gc on c.aban8 = gc.excustomerkey , gc.sourcesystemid = 4 gc.customerid null; select * @mapdimcustomer;
so, says
declare @mapdimcustomer table ( sourcesystemid int, excustomerkey nvarchar(15), customername nvarchar(115), customertypename nvarchar(50) ) insert @mapdimcustomer(sourcesystemid, excustomerkey, customername, customertypename)
customername
can english or chinese. when run this, turns chinese symbols ?????
. know that, if entering customer name, have use n'chinese characters here'
. there way declare that?
as answer question looking @ first character determine unicode value this.
select 4 sourcesystemid , c.aban8 excustomerkey , case when unicode(left(c.abalph, 1)) > 127 c.abalph else c.abdc end customername , c.abat1 customertypename f0101 c left join globaldw.stage.dimcustomer gc on c.aban8 = gc.excustomerkey , gc.sourcesystemid = 4 gc.customerid null;
Comments
Post a Comment