Friday, March 30, 2012

MS SQL Unicode HTML Date Type

Hi,

- I hope this is the right place to ask this question, if not please direct me where's the best place to ask it.

I'm using MS SQL 2005 Express, and would like to ask which data type fits best to store HTML texts (+tags) in unicode languages.

I've tried "text" data type- but it changes the unicode texts to ?, on the other hand varchar data types don't seem to accept the html tags.

Thanks,


You may use either varchar/nvarchar or text/ntext to store HTML tags as any other text.

Regard the ? issue you mentioned this is because of the collation you used. Just use the collation that fints the language you have between your HTML tags.

Suggestion: if you can know the max length of your HTML pages, then use varchar/nvarchar otherwise use text/ntext.

Tip: in most cases if you usedNvarchar orNtext; the ? issue will be solved.

Good luck.

|||

Thanks!

|||

Yes, you need to use either nvarchar or ntext.

Collations are for determining the order of characters (and equal) which is used in sorting, and comparing to see if two strings are equal.

No comments:

Post a Comment