Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Varchar takes more diskspace than Character Type ?
Message
 
À
10/09/2008 10:56:54
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01346349
Message ID:
01346424
Vues:
11
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform