Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disadvantages of Using Text/nText Data Type ? 1

Status
Not open for further replies.

JohnBates

MIS
Feb 27, 2000
1,995
US
hi all,

Seems I remember there are certain things you cannot do with text types that you can do with varchar data types.

In general, isn't it best to use varchar rather than text ?
If you have a col text (16) SQL Server reserves that 16 bytes, whereas varchar(16) would only actually use the amount of space the data actually used, ie JOHN would take 4 bytes if in a varchar column. ?

Thanks, John
 
Or use text/ntext in AFTER triggers. Or GROUP BY. Or CHECKSUM().

If text value has only one (1) character it will still occupy 8kB on disk. So if there are many short text values internal waste of space becomes significant.

And generally speaking any serious manipulation with READTEXT/WRITETEXT/etc is nothing but real pain.

------
[small]<this is sig>
select stuff(stuff(replicate('<P> <B> ', 14), 109, 0, '<.'), 112, 0, '/')
</this is sig>[/small]
[banghead]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top