Re: What does this mean?
- From: David Thielen <thielen@xxxxxxxxxxxxx>
- Date: Tue, 14 Nov 2006 20:40:01 -0800
Thank you - both of you.
Peter - This is a great explanation - I understand why as well as what and
that always helps a lot.
--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com
Cubicle Wars - http://www.windwardreports.com/film.htm
"Peter Yang [MSFT]" wrote:
Hello David,.
As Hari mentioned, in SQL Server 7.0 and SQL Server 2000 we allow to create
a table that contains variable columns with a total length GT. 8060 (the
total sum of fixed length columns must be LT 8060 as well as the length of
an individual column ).
However when exacting an inset or update we fail the statement if the
actual length is GT 8K. In SQL 2005 this execution will succeed
For example
Create table foo (a int, b varchar(5000), c varchar(5000))
If both varchars contain 5000 bytes the insert will succeed in 2000 and
it will fail in the previous releases.
The 8060 limit for individual varchar/varbinary columns is still in place.
Surpassing the 8,060 row size limit may impact performance. This is because
SQL Server still maintains a limit of 8 KB per page. When a combination of
varchar, nvarchar, varbinary, or sql_variant columns exceeds this limit,
SQL Server moves the record column with the largest width to another page,
while maintaining a 24-byte pointer on the original page. Moving large
records to another page happens dynamically as records are lengthened based
on update operations. Update operations that shorten records may result in
records moved back to the original page. In addition, querying and
performing other select operations such as sorts or joins on large records
that contain row-overflow data slows processing time.
To fetch a column values that has been pushed off the main row requires an
extra I/O. Besides, having wide rows also reduces the scan density -
because fewer rows fit on a page.
If you find the table has many rows with overflow data then you should
seriously consider normalizing the table.
In SQL 2005, VarChar(MAX), NVarChar(MAX) and VarBinary(MAX) allow storage
of data up to 2 gigabytes. Image/Text datatype in SQL 2000/2005 is also
stored seperately and will not be covered in 8KB size.
If anything is unclear, please feel free to let's know. Thank you.
Best Regards,
Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications
<http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx>.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
<http://msdn.microsoft.com/subscriptions/support/default.aspx>.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
- References:
- Re: What does this mean?
- From: Hari Prasad
- Re: What does this mean?
- From: Hari Prasad
- Re: What does this mean?
- From: Peter Yang [MSFT]
- Re: What does this mean?
- Prev by Date: Re: What does this mean?
- Next by Date: RE: Createing a DB with osql - passing in the DB name and user rig
- Previous by thread: Re: What does this mean?
- Next by thread: RE: Createing a DB with osql - passing in the DB name and user rights
- Index(es):
Relevant Pages
|