Microsoft SQL Server 2005 Database Design Best Practices

How to exceed the 8000 bytes row length limit?

 

Execute the following script in Query Editor to demonstrate how the 8060 maximum row size can be exceeded in Microsoft SQL Server 2005:

use tempdb
go

create table Huge
(Alpha varchar(8000),
Beta varchar(8000),
Gamma varchar(8000),
Delta varchar(8000))
go

insert Huge values ('1', '2', '3','4')

update Huge set Alpha = replicate('ABCDEFGHIJ',800)

update Huge set Beta = replicate('abcdefghij',800)

update Huge set Gamma = replicate('0123456789',800)

update Huge set Delta = replicate('klmnopqrst',800)
go

select len(Alpha)+len(Beta)+len(Gamma)+len(Delta)
from Huge
go

 

 

The Best SQL Server 2005 Training in the World
 
 
SQLUSA.com Home Page