Welcome to dbForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Problems character sets / special characters dot.Net mssq..

 
   Database Forums (Home) -> General Discussions RSS
Next:  Division error on float data type in DB2  
Author Message
Klaus Herzberg

External


Since: Feb 11, 2008
Posts: 2



(Msg. 1) Posted: Mon Feb 11, 2008 3:28 pm
Post subject: Problems character sets / special characters dot.Net mssql-server
Archived from groups: comp>databases>ms-sqlserver (more info?)

Hi,
I come from the "dark side" php/mysql and there often problems with
character sets (utf-8, latin...) and storing data in datebase.

Exists in the world of dot.net and ms-sql-server similiar problems?

To precise: I have to store xml-data in database. Maybe its better to
encode (like base64) the strings?

Perhaps there are some links to read?

Thanks.

klaus.

 >> Stay informed about: Problems character sets / special characters dot.Net mssq.. 
Back to top
Login to vote
Plamen Ratchev

External


Since: Nov 06, 2007
Posts: 352



(Msg. 2) Posted: Mon Feb 11, 2008 3:30 pm
Post subject: Re: Problems character sets / special characters dot.Net mssql-server [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

You do not need to do any encoding. If you are using SQL Server 2000 then
you can use the NVARCHAR data type (which supports Unicode characters
http://en.wikipedia.org/wiki/Unicode) to store the XML.

SQL Server 2005 added native support for XML data type, which will makes it
the natural choice for storing XML:
http://msdn2.microsoft.com/en-us/library/ms345117.aspx
http://www.code-magazine.com/Article.aspx?quickid=0605081

HTH,

Plamen Ratchev
http://www.SQLStudio.com

 >> Stay informed about: Problems character sets / special characters dot.Net mssq.. 
Back to top
Login to vote
Erland Sommarskog2

External


Since: May 30, 2004
Posts: 1658



(Msg. 3) Posted: Tue Feb 12, 2008 1:01 am
Post subject: Re: Problems character sets / special characters dot.Net mssql-server [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Klaus Herzberg ( ) writes:
> I come from the "dark side" php/mysql and there often problems with
> character sets (utf-8, latin...) and storing data in datebase.
>
> Exists in the world of dot.net and ms-sql-server similiar problems?

Character conversion is always a problem, if you don't do it right. Smile

> To precise: I have to store xml-data in database. Maybe its better to
> encode (like base64) the strings?

No, that is a not a good idea. SQL Server supports Unicode, and there is
also a native xml type (in SQL 2005). What you should be aware of that
SQL Server does not support UTF-8, but always store Unicode data in
UTF-16.

For character data you should use nchar/nvarchar which is Unicode
and not char/varchar which is the local 8-bit set.

--
Erland Sommarskog, SQL Server MVP, esquel RemoveThis @sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
 >> Stay informed about: Problems character sets / special characters dot.Net mssq.. 
Back to top
Login to vote
Klaus Herzberg

External


Since: Feb 11, 2008
Posts: 2



(Msg. 4) Posted: Tue Feb 12, 2008 7:01 pm
Post subject: Re: Problems character sets / special characters dot.Net mssql-server [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Back to top
Login to vote
Display posts from previous:   
Related Topics:
Identifying results sets when stored procedure called mult.. - I have a report based on our product names that consists of two parts. Both insert data into a temporary table. 1. A single grouped set of results based on all products 2. Multiple tables based on individual product names. I am getting data by calling....

Non-English Characters - Hello all, We are developing an add-on for GoldMine, however my problem is a generic SQL Server problem. The situation is this; we have a database, with collation set to SQL Latin. When we connect to database via Goldmine, Enterprise Manager or Delphi..

Numeric value only for a character field - Hi I have a character field (char ot varchar) that I want to force only to contain numeric characters. Can that be done by way of defining a constraint on the field ? or by any other way in the field/table definition ? What id the syntax ? Anyone have..

Output of international characters to text file - We have an export to a text file using xp_cmdshell to echo to a text file. The value of (Hex E5) in the database is being converted to ""(Hex 86). This is just the first example we have found, we're sure there are other problems but looking...

SQL Backup Problems - Problem Background: We are having a [b:6f531b5201]full backup[/b:6f531b5201] to magnetic tape every day. Now, we are going to set up an additional backup schedule(will backup to branches Pc), which is [b:6f531b5201]full backup[/b:6f531b5201] on first..
   Database Forums (Home) -> General Discussions All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum

Warning: fopen(/home/adsense_reject.txt) [function.fopen]: failed to open stream: Permission denied in /home/autoforu/public_html/Giga/GigaFunctions.php on line 1142

Warning: fwrite(): supplied argument is not a valid stream resource in /home/autoforu/public_html/Giga/GigaFunctions.php on line 1143

Warning: fclose(): supplied argument is not a valid stream resource in /home/autoforu/public_html/Giga/GigaFunctions.php on line 1144



[ Contact us | Terms of Service/Privacy Policy ]