Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Varchar takes more diskspace than Character Type ?
Message
 
To
10/09/2008 10:56:54
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01346349
Message ID:
01346424
Views:
10
Hi Sergio,

>Changed one large column (240 chars) from Character to Varchar and size on disc actually increased ???

Yes. Varchars work similar to fields that support NULL values. There's an invisible field in the table call _NullFlags. Varchar fields need one bit in this field. The bit indicates if the value has the maximum size or not. When the bit is set, the first byte in the varchar field on disk indicates the length. Hence the table grows if you haven't had a nullable or varchar field, or remains the same if there's a free bit in the field.
--
Christof
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform