Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Verification on performance
Message
 
 
À
04/10/2010 11:28:01
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 2008
Application:
Web
Divers
Thread ID:
01483774
Message ID:
01483815
Vues:
37
>>Why don't you use DEFAULT constraint and avoid UPDATE that in this case requires table lock?
>>
>>SET @ExecuteSql = N'ALTER TABLE [Client] ADD [test4] char(40) DEFAULT ('''')'
>>
>>
>>Also, wouldn't varchar(40) better choice for the column?
>
>I wasn't aware of the Default clause. Thanks for mentioning it.
>
>I have been used to Char(). Is VarChar() a new standard? Basically, if I define a character field, is this a better type to use?

Yes, for big character fields you may want to use Varchar fields as they take less space assuming you don't need your data to be 40 characters always.

There is a great article http://aboutsqlserver.com/2010/08/11/how-sql-server-stores-data-extents-data-pages-data-row-for-in-row-data/ explaining the innards of SQL Server.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform