Showing posts with label characters. Show all posts
Showing posts with label characters. Show all posts

Sunday, February 26, 2012

Does any one have similar problem with nvarchar column storing chinese characters?

I am running into some wired problem with nvarchar(4000). When I insert the
chinese characters, the text got cut off. The following two sections shows
what happen, the first chinese section is what is ended up in the database,
the second section (separate by "--") show the complete
parameter value before IDbCommand.ExecuateQuery() is called. It is less
than 4000 bytes. It seems a chunk of text got loss somewhere.
No sure what happen here. But it seems to be a serious problem. My full
text search certainlly wouldn't work if I can't get the data into the
column. Is this a bug in 2005 CTP or something I did wrong ? Thanks
--Xin Chen
?...?? - ? - ? - ?... ? - ?Q - ?... ?
- ? - ?... ? - ? ? > ? > ? ??
?:2005?03?23?03:56?:????
?
????
???
??1937?12?13?27???,??
??,?,??
"? ?...?? - ? - ? - ?... ? - ?Q - ?... ?
? - ? - ?... ? - ? ? > ? > ? ??\n
?:2005?03?23?03:56?:????
?\n???? \n \n??
? \n ??1937?12?13?27???,?
???,?,???,??
????,??30??
?,???,??,??,??,?
???1938?3?24?,????,?
??2?31? ??,?27?,?
??,?31??,??28?,?
?31?,??29?,?2??,?
??,?2???31?,???
?4?3?,????,?
???,??,???
6?,???7?,???
?,???????
?,???,?4.6?,?7500?
??,??1????
??,??? ?\n ??
??\n ?? ????
???\n??? ??
\n?? ??\n??3-26
? ??\n?? ??\n?
?? ??\n?:? ?<?
?> \n ? ??"?"??:? ?
? ? \n -- ?? ChinaRen - ? - ? - ?
? - ? - ? - ? - ? - ?? - About SOHU -
?\nCopyright 2005 Sohu.com Inc.All rights reserved."
how are you inserting these characters? OpenRowset?
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Xin Chen" <xchen@.xtremework.com> wrote in message
news:ulgv5WANFHA.1176@.TK2MSFTNGP15.phx.gbl...
> I am running into some wired problem with nvarchar(4000). When I insert
the
> chinese characters, the text got cut off. The following two sections
shows
> what happen, the first chinese section is what is ended up in the
database,
> the second section (separate by "--") show the complete
> parameter value before IDbCommand.ExecuateQuery() is called. It is less
> than 4000 bytes. It seems a chunk of text got loss somewhere.
> No sure what happen here. But it seems to be a serious problem. My full
> text search certainlly wouldn't work if I can't get the data into the
> column. Is this a bug in 2005 CTP or something I did wrong ? Thanks
> --Xin Chen
> ?...?? - ? - ? - ?... ? - ?Q - ?... ?
> - ? - ?... ? - ? ? > ? > ? ??
> ?:2005?03?23?03:56?:????
> ?
> ????
> ???
> ??1937?12?13?27???,??
> ??,?,??
> ----
--
> --
> "? ?...?? - ? - ? - ?... ? - ?Q - ?... ?
> ? - ? - ?... ? - ? ? > ? > ? ??\n
> ?:2005?03?23?03:56?:????
> ?\n???? \n \n??
> ? \n ??1937?12?13?27???,?
> ???,?,???,??
> ????,??30??
> ?,???,??,??,??,?
> ???1938?3?24?,????,?
> ??2?31? ??,?27?,?
> ??,?31??,??28?,?
> ?31?,??29?,?2??,?
> ??,?2???31?,???
> ?4?3?,????,?
> ???,??,???
> 6?,???7?,???
> ?,???????
> ?,???,?4.6?,?7500?
> ??,??1????
> ??,??? ?\n ??
> ??\n ?? ????
> ???\n??? ??
> \n?? ??\n??3-26
> ? ??\n?? ??\n?
> ?? ??\n?:? ?<?
> ?> \n ? ??"?"??:? ?
> ? ? \n -- ?? ChinaRen - ? - ? - ?
> ? - ? - ? - ? - ? - ?? - About SOHU -
> ?\nCopyright 2005 Sohu.com Inc.All rights reserved."
>
|||no, I am using a store proc and call it via ADO.NET in my app
I store my text in the nvarchar(4000) as string, I am not using openrowset.
the stored proc use regular insert into (...) values (...)
--Xin Chen
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
news:exEotkANFHA.2468@.tk2msftngp13.phx.gbl...[vbcol=seagreen]
> how are you inserting these characters? OpenRowset?
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTS
> http://www.indexserverfaq.com
> "Xin Chen" <xchen@.xtremework.com> wrote in message
> news:ulgv5WANFHA.1176@.TK2MSFTNGP15.phx.gbl...
> the
> shows
> database,
complete
> ----
> --
>

Friday, February 24, 2012

Does "text type" belong to SQL2 standard ?

Hi,

I am developping an application that should work with different RDBMS.

I need to store a field of 500 characters.

Hence, I thought of using the type "text" that works with MySQL, but I am wondering if it is part of SQL standard or if it is supported by the main RBDMS (Orcale, DB2, SQL Server ...).

Thanks in advance,

SylvainThe "Text" datatype is not part of the ANSI SQL99 standard. Most vendors also have their own variants of datatypes. The nearest agreements in datatypes for your purposes I guess would be to use a VARCHAR. However there is still variation, in Oracle this would be a VARCHAR2.

Hope this help you on your way.|||Hi,

Originally posted by gannet
The "Text" datatype is not part of the ANSI SQL99 standard. Most vendors also have their own variants of datatypes. The nearest agreements in datatypes for your purposes I guess would be to use a VARCHAR. However there is still variation, in Oracle this would be a VARCHAR2.


But with MySQL for example VARCHAR is limited to 255. We can't do VARCHAR(500).

So you see any solution ?

Regards
Sylvain|||Unfortunately there will be no vendor independent way araound this, you will need to generate some vendor specific translations. Not what you wanted to hear I know.