Monday, March 19, 2012

maximum row size.. 8060 bytes ?

I got a warning like this.
Warning: The table 'tbSOTransHeader' has been created but
its maximum row size (9911) exceeds the maximum number of
bytes per row (8060). INSERT or UPDATE of a row in this
table will fail if the resulting row length exceeds 8060
bytes.
My questions are :
1. Is it true max row size is 8060 bytes ?
2. Can we make it larger ?
Thanks.Yes the max amount of actual data in the row can only be 8060. You can
create a table, view etc larger than that with variable length columns as
long as when populated they don't total more than that. NO you can't make
it larger.
--
Andrew J. Kelly
SQL Server MVP
"kresna rudy kurniawan" <kresnark@.yahoo.com> wrote in message
news:082a01c3728f$48917d50$a301280a@.phx.gbl...
> I got a warning like this.
> Warning: The table 'tbSOTransHeader' has been created but
> its maximum row size (9911) exceeds the maximum number of
> bytes per row (8060). INSERT or UPDATE of a row in this
> table will fail if the resulting row length exceeds 8060
> bytes.
> My questions are :
> 1. Is it true max row size is 8060 bytes ?
> 2. Can we make it larger ?
> Thanks.
>|||Is there a function or stored procedure in T-sql to
calculate bytes in a row ?
thx.
>--Original Message--
>Yes the max amount of actual data in the row can only be
8060. You can
>create a table, view etc larger than that with variable
length columns as
>long as when populated they don't total more than that.
NO you can't make
>it larger.
>--
>Andrew J. Kelly
>SQL Server MVP
>
>"kresna rudy kurniawan" <kresnark@.yahoo.com> wrote in
message
>news:082a01c3728f$48917d50$a301280a@.phx.gbl...
>> I got a warning like this.
>> Warning: The table 'tbSOTransHeader' has been created
but
>> its maximum row size (9911) exceeds the maximum number
of
>> bytes per row (8060). INSERT or UPDATE of a row in this
>> table will fail if the resulting row length exceeds 8060
>> bytes.
>> My questions are :
>> 1. Is it true max row size is 8060 bytes ?
>> 2. Can we make it larger ?
>> Thanks.
>>
>
>.
>|||use datalength.
ex: select datalength(col1) + datalength(col2) ... from <table>
--
-Vishal
kresna rudy kurniawan <kresnark@.yahoo.com> wrote in message
news:163c01c37293$55393f80$a601280a@.phx.gbl...
> Is there a function or stored procedure in T-sql to
> calculate bytes in a row ?
> thx.
>
> >--Original Message--
> >Yes the max amount of actual data in the row can only be
> 8060. You can
> >create a table, view etc larger than that with variable
> length columns as
> >long as when populated they don't total more than that.
> NO you can't make
> >it larger.
> >
> >--
> >
> >Andrew J. Kelly
> >SQL Server MVP
> >
> >
> >"kresna rudy kurniawan" <kresnark@.yahoo.com> wrote in
> message
> >news:082a01c3728f$48917d50$a301280a@.phx.gbl...
> >> I got a warning like this.
> >>
> >> Warning: The table 'tbSOTransHeader' has been created
> but
> >> its maximum row size (9911) exceeds the maximum number
> of
> >> bytes per row (8060). INSERT or UPDATE of a row in this
> >> table will fail if the resulting row length exceeds 8060
> >> bytes.
> >>
> >> My questions are :
> >>
> >> 1. Is it true max row size is 8060 bytes ?
> >> 2. Can we make it larger ?
> >>
> >> Thanks.
> >>
> >>
> >
> >
> >.
> >|||kresna rudy kurniawan wrote:
> I got a warning like this.
> Warning: The table 'tbSOTransHeader' has been created but
> its maximum row size (9911) exceeds the maximum number of
> bytes per row (8060). INSERT or UPDATE of a row in this
> table will fail if the resulting row length exceeds 8060
> bytes.
> My questions are :
> 1. Is it true max row size is 8060 bytes ?
> 2. Can we make it larger ?
> Thanks.
All columns of the row have to fit in the page (maximum 8060 bytes),
except for data types text, ntext and image. For those data types, only
16 bytes (for each text/ntext/image column) are needed in the page that
stores the row.
So if the current data does not fit the page, it might be an option to
change large char, nchar, varchar or nvarchar columns to text or ntext.
Hope this helps,
Gert-Jan

No comments:

Post a Comment