Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Verification on performance
Message
 
 
To
04/10/2010 11:28:01
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 2008
Application:
Web
Miscellaneous
Thread ID:
01483774
Message ID:
01483815
Views:
36
>>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform