| Author |
Topic |
|
chrispy
Posting Yak Master
107 Posts |
Posted - 2002-02-23 : 22:22:01
|
| All, I have dynamic procedure that displyas a page of product specifications. Once this is run it is pretty static, so lets dump the HTML into SQL. I am using the ntext for string the HTML and all is well. After reading through the forum here I see a lot of blasintg on the ntext. Saying that I should use nvarchar and past them together. The ntext seems to be working excellent for me, no unicode issues or such and and displaying the var right to the page no problem. What are the catches with ntext, am I missing something here? |
|
|
Merkin
Funky Drop Bear Fearing SQL Dude!
4970 Posts |
Posted - 2002-02-23 : 22:43:48
|
If it works for you, then fine. The problems with text and ntext are that they are slower as they are stored in a different place to the rest of your data. You also can not use a lot of the string manipulation functions like you can with a varchar.So for your application, if it is all working fine, then don't worry. Ignore Robvolk's ntext bashing, he doesn't know what he is on about, I mean, did you read his Identity article, sheeeeesh. Damian |
 |
|
|
chrispy
Posting Yak Master
107 Posts |
Posted - 2002-02-23 : 23:08:10
|
| Merkin, Thanks for the reinforcement. I need to do nothing in the SQL side to this column. Just read and write. The HTML is generated in script and stored in the DB. I will try to ignore the ntext bashing than.Chris |
 |
|
|
graz
Chief SQLTeam Crack Dealer
4149 Posts |
Posted - 2002-02-24 : 00:43:50
|
| You might check out http://www.sqlteam.com/item.asp?ItemID=202. It's an early article but might give some insight into what I did here.===============================================Creating tomorrow's legacy systems today.One crisis at a time. |
 |
|
|
chrispy
Posting Yak Master
107 Posts |
Posted - 2002-02-24 : 09:37:32
|
| I thought I already replied to this but seemed to of lost it somewhere Graz, In you case your are only submiting straight text (no html), that is under 8k. In my case I am up to 50k or so with all of the html as well. I have always had issues with unicode formating when using nvarchar, and am suprised to see none with ntext. Striaght into db and straight out of db with no formating. If I am only reading and righting to the ntext field, there seems to be no downfalls. What I am creating is a spec sheet for a product. Table has 2 columns Product_Id nvchar(40) and spec_html ntext(16). Seeing that I am only reading and writing and plan on doing nothing else with the ntext. See any problems?Thanks again,Chris |
 |
|
|
graz
Chief SQLTeam Crack Dealer
4149 Posts |
Posted - 2002-02-24 : 10:24:53
|
| Actually the article is about storing HTML in text fields. That's how I run SQLTeam.com. All the articles -- which means HTML -- is stored in text fields. Works great for me. Just make sure when you do a SELECT from an ASP page that the text field is the last field in the select list.===============================================Creating tomorrow's legacy systems today.One crisis at a time. |
 |
|
|
chrispy
Posting Yak Master
107 Posts |
Posted - 2002-02-24 : 10:29:05
|
| Graz, Then the statement about and article over 8000 chars is not entirely correct. With the HTML as well it would have to be under somewaht. I assumed that by the 8k article you meant 8k of actual text. BTW I am aware of putting ntext last in the select statement. Not sure why this is but I am behaving. I am not in the situation, but what if I had to select two ntext columns? Can HTML be store in a text column?Thanks again,Chris |
 |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2002-02-24 : 21:42:05
|
If you need to maintain unicode characters, then you need ntext. If not, regular text will suffice, and will use one byte per character for storage instead of two bytes. SQL Team only needs to store regular text, that's why graz uses it. There is some HTML code in SQL Team posts, and some posts are more than 8K in size, and regular text accommodates this nicely.If you are storing HTML, then the tags are included in the amount of data being stored. To SQL Server, an HTML tag is data just as much as the non-HTML text is.Damian...Damian...Damian...always trying to get me in trouble! |
 |
|
|
|