You are here: Re: MSSQL varchar vs. text « PHP SQL « IT news, forums, messages
Re: MSSQL varchar vs. text

Posted by Steve on 12/07/05 11:23

> What's the essential difference between the two field types varchar and text.

I guess this refers to this <mssql_field_length> and the user notes by
"marc at NOSPAM dot durdin dot net" here: <http://uk.php.net/mssql>.
The workaround mentioned is:

-- for example, with MyVarCharField VARCHAR(1000)
SELECT CAST(MyVarCharField AS TEXT) FROM MyTable

>From the SQL Server BOL for MSSQL2000:

"...character data is stored using the char, varchar, and text data
types. Use varchar when the entries in a column vary in the number of
characters they contain, but the length of any entry does not exceeds 8
kilobytes (KB). Use char when every entry for a column has the same
fixed length (up to 8 KB). Columns of text data can be used to store
ASCII characters longer than 8 KB."

There will definitely be a performance hit when using TEXT instead of
CHAR or VARCHAR. You'll have to make some tests to see if you could
live with that.

---
Steve

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация