on 07-17-2008 10:58 AM
I am sorry for my poor english.
I install sap base on sqlserver with SQL_Latin1_General_CP850_BIN2, but when i directly use database sql to insert chinese string into table, it comes Unrecognizable Code.
eg. insert into table(field1) values('chinese string')
How to solve this problem? Thank you.
Yes, insert into KEVIN_TEST values (N'测试') work ok.
But the prefix 'N' is only for constant, and how to do with variable?
Eg:
-
declare @s1 nvarchar(20)
declare @s2 nvarchar(10)
set @s1=N'测试TEST'
set @s2=substring(@s1,1,2)
insert into Table1(Field1) values(@s2)
-
How to do with @s2?
Thank very much.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have no problem with SAP inserting into the database, but with SQL Management Studio, the chinese string can't properly insert or select. But if i insert from other program language, such as Delphi,it does correct. So i also think the reason is difference between SAP's encoding with the database and MS SQL Management Studio.
But how to solve this problem?
OS: Windows 2003 Enterprise Editon SP1(Simple Chinese)
MS SQL: SQL2005 Enterprise Editon(Simple Chinese)
SAP: Netweaver 2004s SR2
Thank.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think the problem is not with the insert into the DB, because I was able to do that successfully. The problem is when you try to read it back from the DB, which depends on the front-end language it may not display correctly. Here's a quick little test I just did.
My OS: Windows 2003 SP2 English.
DB: SQL 2005 SP2 English. 850 BIN2 unicode.
create table KEVIN_TEST (texttest nvarchar(30))
go
insert into KEVIN_TEST values ('测试')
go
select * from KEVIN_TEST
Result from the last select:
texttest
-
??
(1 row(s) affected)
It's displaying as ?? because my front end is Enlish. I believe this is what's happening, I'll ask the SQL dev team to see if I can find out more for you. Give me 24 hours.
I believe that the reason is difference between SAP's encoding with the database compared to you using SQL Management Studio. Do you have problems with SAP inserting into the database?
What error are you getting?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
MS SQL Server 2005 consists for default for SQL_Latin1_General_CP850_BIN2.
So you cant change to BIN collation.
Regards,
Srini Nookala
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for your reply.
SqlServer: SqlServer2005 Version9.00.1399.06 Simple Chinese Enterprise Editon
SAP: NetWeaver ABAP 2004s SR2
Edited by: zhou yang on Jul 17, 2008 1:27 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Can you explain more information about your SQL Server version and SAP version.
Your error is ocured due to BIN2 collation.
Regards,
Srini Nookala
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.