Friday, March 23, 2012
row size SQL 7
I have wrote a select stmt to return data in our sql 7 db as we are
decomissiong it but getting error:
"Cannot sort a row of size 8262, which is greater than the allowable maximum
of 8094."
help
thx
Well, the error message seems pretty straightforward to me, what is your
ORDER BY clause and what are the data types of the columns mentioned in it?
"stoney" <stoney@.discussions.microsoft.com> wrote in message
news:43E0BE09-A85A-4C09-9747-C7F6F1267B2A@.microsoft.com...
> Hello,
> I have wrote a select stmt to return data in our sql 7 db as we are
> decomissiong it but getting error:
> "Cannot sort a row of size 8262, which is greater than the allowable
> maximum
> of 8094."
> help
> thx
|||yes I know the error is straitforward, is there a way around it? the column
in question is varchar 8000
"Aaron Bertrand [SQL Server MVP]" wrote:
> Well, the error message seems pretty straightforward to me, what is your
> ORDER BY clause and what are the data types of the columns mentioned in it?
>
> "stoney" <stoney@.discussions.microsoft.com> wrote in message
> news:43E0BE09-A85A-4C09-9747-C7F6F1267B2A@.microsoft.com...
>
>
|||You can try the ROBUST PLAN hint. It isn't guaranteed to work, though, depending on what it is you
are doing.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"stoney" <stoney@.discussions.microsoft.com> wrote in message
news:74E17ACD-2216-4540-BB84-04DDE2C0BEE3@.microsoft.com...[vbcol=seagreen]
> yes I know the error is straitforward, is there a way around it? the column
> in question is varchar 8000
> "Aaron Bertrand [SQL Server MVP]" wrote:
|||How about ORDER BY LEFT(YourCol,8000)
Andrew J. Kelly SQL MVP
Solid Quality Mentors
"stoney" <stoney@.discussions.microsoft.com> wrote in message
news:74E17ACD-2216-4540-BB84-04DDE2C0BEE3@.microsoft.com...[vbcol=seagreen]
> yes I know the error is straitforward, is there a way around it? the
> column
> in question is varchar 8000
> "Aaron Bertrand [SQL Server MVP]" wrote:
|||> How about ORDER BY LEFT(YourCol,8000)
Unless the varchar(8000) values are all very similar, you could probably
achieve very similar results with simply
ORDER BY LEFT(YourCol, 32)
I am assuming there are other columns in the ORDER BY list, because of the
number reported in the error message (8262).
row size SQL 7
I have wrote a select stmt to return data in our sql 7 db as we are
decomissiong it but getting error:
"Cannot sort a row of size 8262, which is greater than the allowable maximum
of 8094."
help
thxWell, the error message seems pretty straightforward to me, what is your
ORDER BY clause and what are the data types of the columns mentioned in it?
"stoney" <stoney@.discussions.microsoft.com> wrote in message
news:43E0BE09-A85A-4C09-9747-C7F6F1267B2A@.microsoft.com...
> Hello,
> I have wrote a select stmt to return data in our sql 7 db as we are
> decomissiong it but getting error:
> "Cannot sort a row of size 8262, which is greater than the allowable
> maximum
> of 8094."
> help
> thx|||yes I know the error is straitforward, is there a way around it? the column
in question is varchar 8000
"Aaron Bertrand [SQL Server MVP]" wrote:
> Well, the error message seems pretty straightforward to me, what is your
> ORDER BY clause and what are the data types of the columns mentioned in it?
>
> "stoney" <stoney@.discussions.microsoft.com> wrote in message
> news:43E0BE09-A85A-4C09-9747-C7F6F1267B2A@.microsoft.com...
> > Hello,
> >
> > I have wrote a select stmt to return data in our sql 7 db as we are
> > decomissiong it but getting error:
> > "Cannot sort a row of size 8262, which is greater than the allowable
> > maximum
> > of 8094."
> >
> > help
> >
> > thx
>
>|||You can try the ROBUST PLAN hint. It isn't guaranteed to work, though, depending on what it is you
are doing.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"stoney" <stoney@.discussions.microsoft.com> wrote in message
news:74E17ACD-2216-4540-BB84-04DDE2C0BEE3@.microsoft.com...
> yes I know the error is straitforward, is there a way around it? the column
> in question is varchar 8000
> "Aaron Bertrand [SQL Server MVP]" wrote:
>> Well, the error message seems pretty straightforward to me, what is your
>> ORDER BY clause and what are the data types of the columns mentioned in it?
>>
>> "stoney" <stoney@.discussions.microsoft.com> wrote in message
>> news:43E0BE09-A85A-4C09-9747-C7F6F1267B2A@.microsoft.com...
>> > Hello,
>> >
>> > I have wrote a select stmt to return data in our sql 7 db as we are
>> > decomissiong it but getting error:
>> > "Cannot sort a row of size 8262, which is greater than the allowable
>> > maximum
>> > of 8094."
>> >
>> > help
>> >
>> > thx
>>|||How about ORDER BY LEFT(YourCol,8000)
--
Andrew J. Kelly SQL MVP
Solid Quality Mentors
"stoney" <stoney@.discussions.microsoft.com> wrote in message
news:74E17ACD-2216-4540-BB84-04DDE2C0BEE3@.microsoft.com...
> yes I know the error is straitforward, is there a way around it? the
> column
> in question is varchar 8000
> "Aaron Bertrand [SQL Server MVP]" wrote:
>> Well, the error message seems pretty straightforward to me, what is your
>> ORDER BY clause and what are the data types of the columns mentioned in
>> it?
>>
>> "stoney" <stoney@.discussions.microsoft.com> wrote in message
>> news:43E0BE09-A85A-4C09-9747-C7F6F1267B2A@.microsoft.com...
>> > Hello,
>> >
>> > I have wrote a select stmt to return data in our sql 7 db as we are
>> > decomissiong it but getting error:
>> > "Cannot sort a row of size 8262, which is greater than the allowable
>> > maximum
>> > of 8094."
>> >
>> > help
>> >
>> > thx
>>|||> How about ORDER BY LEFT(YourCol,8000)
Unless the varchar(8000) values are all very similar, you could probably
achieve very similar results with simply
ORDER BY LEFT(YourCol, 32)
I am assuming there are other columns in the ORDER BY list, because of the
number reported in the error message (8262).
Row Size of each row in each table - Urgent
So for example if I have 5 rows each in 3 tables I need a query that will return 15 rows with the size of each row(size of all coumn data summed together). Thanks.You should be able to make use of theDATALENGTH function for this information.|||
You can use sp_spaceused @.tableName to displays the number of rows, disk space reserved, and disk space used by a table in the current database. There is no direct to retrieve exact rowsize for each row (e.g. rows with VARCHAR/TEXT data), so we can estimate the average rowsize for each table. Here is a quick sample:
CREATE PROCEDURE sp_GetAvgRowSize @.TableName sysname=null
AS
DECLARE @.TotalRowSize decimal(8,2),@.RowCount int,@.TblID int,@.TblCnt int
IF @.TableName is not null
BEGIN
select @.TotalRowSize=sum(dpages),@.RowCount=max(rowcnt)
from sysindexes
where id=object_id(@.TableName)
and indid<2
select @.TotalRowSize=isnull(sum(used),0)+@.TotalRowSize
from sysindexes
where id=object_id(@.TableName)
and indid=255
SELECT @.TotalRowSize=@.TotalRowSize*8
SELECT @.TableName as 'TableName',@.RowCount as 'RowCount',
convert(varchar(100),convert(decimal(8,2),(@.TotalRowSize/@.RowCount)))+'KB' as 'AvgRowSize'
END
ELSE
BEGIN
SELECT name,id into #tbl_UserTables from sysobjects where xtype='U'
SELECT @.TblID=max(id),@.TblCnt=count(*) from #tbl_UserTables
WHILE @.TblCnt >0
BEGIN
select @.TotalRowSize=sum(dpages),@.RowCount=max(rowcnt)
from sysindexes
whereid=@.TblID
and indid<2
select @.TotalRowSize=isnull(sum(used),0)+@.TotalRowSize
from sysindexes
whereid=@.TblID
and indid=255
SELECT @.TotalRowSize= @.TotalRowSize*8
SELECT object_name(@.TblID) as 'TableName',@.RowCount as 'RowCount',
'AvgRowSize'=CASE @.RowCount
WHEN 0 THEN 'No Rows in the table'
ELSE convert(varchar(100),convert(decimal(8,2),(@.TotalRowSize/@.RowCount)))+'KB'
END
DELETE FROM #tbl_UserTables WHEREID=@.TblID
SELECT @.TblID=max(id),@.TblCnt=count(*) from #tbl_UserTables
END
END
go
|||
Iori_Jay:
There is no direct to retrieve exact rowsize for each row (e.g. rows with VARCHAR/TEXT data)
DATALENGTH will tell you the number of bytes in a column, even varchar and text columns.|||Thanks for your remind
lori_jay is correct, there is no way that I know of to get the exact amount of space a row is taking on disk.
tmorton is also correct in that Datalength will tell you the amount of bytes that a field contains, but it won't tell you about the overhead/pointer space/space wasted per field, row overhead, or wasted space in a page.
If all you really need is the number of bytes that is contained withing a row, then add the datalengths. If you really wanted to know how much disk space a row consumes, then it's *VERY* inaccurate, and lori_jay's approach is better, although it doesn't say on a per-row basis.
Row size limitations of SQL Server 2005
I've created a database design and I'm trying to figure out if it's workable or not. I have 2 tables in particular that are sparse (20 columns, but only a few have data - about 100 bytes/row) but will grow very large - to the tune of 700 million rows.
My question is whether or not there is a problem with SQL Server 2005 having 1.5+ billion rows of data even though it will likely only take up 100 gigs or so on disk. Anyone have experience in large numbers of rows like this? We're still doing testing as far determining how slow queries will get.
Thanks,
Craig
That's fine. SQL Server can deal with that many rows of data. I've worked with tables with billions of rows before. Don't forget to plan for your index space as well and any necessary index maintenance.
-Sue
|||Try the link below for the SQL Server Max CAP.
http://msdn2.microsoft.com/en-us/library/ms143432.aspx
Row Size Limitation of Report Model?
Hello,
I am trying to create a Report Model based on Data View that references a SQL View.
I get a an error when building the Report Model based on this view:
An error occurred while executing a command.
Message: Arithmetic overflow error converting expression to data type int.
Command: SELECT COUNT(*) FROM [dbo].[myViewName]
I don't know exactly how many rows are returned from this view, but I do know that it can contain quite a few rows. I tried to find out how many rows were in the view by running a SELECT COUNT() on the view, but I got the following error from SQL Server 2005 query window:
Msg 8115, Level 16, State 2, Line 1
Arithmetic overflow error converting expression to data type int.
This appears to be a SQL 2005 issue, but affects me building a Report Model. My question is, is this a SQL Server 2005 issue? Is there a way around it (other than chaning my view to decrease the amount of rows in it)?
BTW...I am running SQL 2005 Developer Edition on a Windows XP (SP2) laptop.
Thanks!!
Brian
Nevermind. It looks like there was an error in the view that I was using.This does bring up a good question though...Are there limitations to how much data (number of rows) can be used with a Report Model?
Thanks!
Brian|||No, there is technically no limit, although certain expressions like Count(<entity>) could overflow if you have more than 2^31 (~2 billion) rows.|||what can i do if my count(*) exceeds the limit. I have this situation now already.sql
Row Size Limitation of Report Model?
Hello,
I am trying to create a Report Model based on Data View that references a SQL View.
I get a an error when building the Report Model based on this view:
An error occurred while executing a command.
Message: Arithmetic overflow error converting expression to data type int.
Command: SELECT COUNT(*) FROM [dbo].[myViewName]
I don't know exactly how many rows are returned from this view, but I do know that it can contain quite a few rows. I tried to find out how many rows were in the view by running a SELECT COUNT() on the view, but I got the following error from SQL Server 2005 query window:
Msg 8115, Level 16, State 2, Line 1
Arithmetic overflow error converting expression to data type int.
This appears to be a SQL 2005 issue, but affects me building a Report Model. My question is, is this a SQL Server 2005 issue? Is there a way around it (other than chaning my view to decrease the amount of rows in it)?
BTW...I am running SQL 2005 Developer Edition on a Windows XP (SP2) laptop.
Thanks!!
Brian
Nevermind. It looks like there was an error in the view that I was using.This does bring up a good question though...Are there limitations to how much data (number of rows) can be used with a Report Model?
Thanks!
Brian|||No, there is technically no limit, although certain expressions like Count(<entity>) could overflow if you have more than 2^31 (~2 billion) rows.|||what can i do if my count(*) exceeds the limit. I have this situation now already.
Row Size Limit?
UPDATE tb_tmp
SET sm_PublicText = CONVERT(NVARCHAR(2000), @.data)
WHERE sm_pk = @.id
BUT, at my client's server it does NOT - no errors given, just it is left
NULL. To work I have to change the 2000 (in convert) to 200.
Does he has some row size limit. Where can I look?
Evanpermissions for client?
"Evan Camilleri" wrote:
> The following works on my server:
> UPDATE tb_tmp
> SET sm_PublicText = CONVERT(NVARCHAR(2000), @.data)
> WHERE sm_pk = @.id
>
> BUT, at my client's server it does NOT - no errors given, just it is left
> NULL. To work I have to change the 2000 (in convert) to 200.
> Does he has some row size limit. Where can I look?
>
> Evan
>
>|||The row size limit in 2000 and below is 8060 bytes (including overhead). In
2005, you can overflow
the regular variable length datatypes.
Either way, the max row size does not include text, ntext, image, and the ne
w varchar(max),
nvarchar(max) and varbinary(max).
If it were an overflow problem, SQL Server would return an error message. Pe
rhaps the client
application suppresses this error? Did you execute the UPDATE from Query ana
lyzer, or? Or perhaps
there's a trigger on the table which silently modifies the column value?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Evan Camilleri" <e70mt@.yahoo.co.uk.nospam> wrote in message
news:%23hTaOk4kGHA.3924@.TK2MSFTNGP03.phx.gbl...
> The following works on my server:
> UPDATE tb_tmp
> SET sm_PublicText = CONVERT(NVARCHAR(2000), @.data)
> WHERE sm_pk = @.id
>
> BUT, at my client's server it does NOT - no errors given, just it is left
NULL. To work I have to
> change the 2000 (in convert) to 200.
> Does he has some row size limit. Where can I look?
>
> Evan
>|||I do not think permissions have to do with it since CONVERT(NVARCHAR(200),
@.data) works (with 200 it works, with 2000 it does not)
"marcmc" <marcmc@.discussions.microsoft.com> wrote in message
news:41715CFE-A538-46A4-B17E-9BBC8B383342@.microsoft.com...
> permissions for client?
>
> "Evan Camilleri" wrote:
>|||Check the table definition, also look for any triggers.
ML
http://milambda.blogspot.com/|||
Thanks for your reply. We used Query Analyzer. There is no triggers.
Before this sp is executed I DROP the table and recreate it in the sp
itself... so there is no trigger.
DROP TABLE tb_tmp
CREATE TABLE tb_tmp (
[sm_pk] [int] NOT NULL,
[sm_Ref] [nvarchar] (50) NULL ,
[sm_PublicText] text NULL
)
ALTER TABLE tb_tmp WITH NOCHECK ADD CONSTRAINT [PK_tb_SM] PRIMARY
KEY CLUSTERED ([sm_pk])
INSERT INTO tb_tmp (sm_pk, sm_PublicText)
VALUES (@.id, '')
.......................................SET @.data here
--PRINT @.data ....................prints correctly
-- Save
UPDATE tb_tmp
SET sm_PublicText = CONVERT(NVARCHAR(4000), @.data)
WHERE sm_pk = @.id
As I said this works on my server BUT DOES NOT on the server of the client.
It leaves the row NULL. If I change the 4000 to 500 it works (obviously
truncating my records)
Evan
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:%23K3%23I64kGHA.3596@.TK2MSFTNGP05.phx.gbl...
> The row size limit in 2000 and below is 8060 bytes (including overhead).
> In 2005, you can overflow the regular variable length datatypes.
> Either way, the max row size does not include text, ntext, image, and the
> new varchar(max), nvarchar(max) and varbinary(max).
> If it were an overflow problem, SQL Server would return an error message.
> Perhaps the client application suppresses this error? Did you execute the
> UPDATE from Query analyzer, or? Or perhaps there's a trigger on the table
> which silently modifies the column value?
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Evan Camilleri" <e70mt@.yahoo.co.uk.nospam> wrote in message
> news:%23hTaOk4kGHA.3924@.TK2MSFTNGP03.phx.gbl...
>|||this is the SP:
DROP TABLE tb_tmp
CREATE TABLE tb_tmp (
[sm_pk] [int] NOT NULL,
[sm_Ref] [nvarchar] (50) NULL ,
[sm_PublicText] text NULL
)
ALTER TABLE tb_tmp WITH NOCHECK ADD CONSTRAINT [PK_tb_SM] PRIMARY
KEY CLUSTERED ([sm_pk])
INSERT INTO tb_tmp (sm_pk, sm_PublicText)
VALUES (@.id, '')
.......................................SET @.data here
--PRINT @.data ....................prints correctly
-- Save
UPDATE tb_tmp
SET sm_PublicText = CONVERT(NVARCHAR(4000), @.data)
WHERE sm_pk = @.id
As I said this works on my server BUT DOES NOT on the server of the client.
It leaves the row NULL. If I change the 4000 to 500 it works (obviously
truncating my records)
"ML" <ML@.discussions.microsoft.com> wrote in message
news:3F67A2FD-1B7B-40C2-AF32-4524C35961CA@.microsoft.com...
> Check the table definition, also look for any triggers.
>
> ML
> --
> http://milambda.blogspot.com/|||Try casting the value as the actual column's data type:
CONVERT(text, @.data)
ML
http://milambda.blogspot.com/
Row size increase....
I have large test data. I have face problem with row size greater than 8060
then it give me warning/error. If i want to store in row greater than 8060
then how to do? Is it any possible way? I try with ntext and sp_tableoption
but it gives me upto 256.
And i read in theory BLOB and all but how to use that?
Thanks in advance.
MilindHi
You may want to read
http://msdn.microsoft.com/library/d...r />
_8orl.asp
http://msdn.microsoft.com/library/d...r />
_6zec.asp
There is alot of other information regarding ntext/image in Books online.
John
"Milind" wrote:
> Hi,
> I have large test data. I have face problem with row size greater than 806
0
> then it give me warning/error. If i want to store in row greater than 8060
> then how to do? Is it any possible way? I try with ntext and sp_tableoptio
n
> but it gives me upto 256.
> And i read in theory BLOB and all but how to use that?
> Thanks in advance.
> Milind|||"Milind" schrieb:
> Hi,
> I have large test data. I have face problem with row size greater than 806
0
> then it give me warning/error. If i want to store in row greater than 8060
> then how to do? Is it any possible way? I try with ntext and sp_tableoptio
n
> but it gives me upto 256.
> And i read in theory BLOB and all but how to use that?
> Thanks in advance.
> Milind
There is no way to store more than 8060 bytes in a record (you cannot exceed
the page size with a record). Split the data and spread them to several
tables, connected by a common primary key!
The only exception to that rule are the blobs (images and texts) as they are
stored in a different location and the record contains only a pointer to tha
t
location. A single text field can contain up to 2 GB of text, but requires
only 4 Bytes in your record. But beware: it is not as easy to handle these
fields later (indexing, searching etc.) as it is with 'normal' data fields.|||If your table has one or more varchar columns resulting in a record layout
with a maximum possible size > 8060, then you can ignore the warning so long
as you don't actually submit an insert or update that would store more than
that maximum.
"Milind" <Milind@.discussions.microsoft.com> wrote in message
news:86D1FA64-C1FB-4781-AE05-FB910464A2E2@.microsoft.com...
> Hi,
> I have large test data. I have face problem with row size greater than
8060
> then it give me warning/error. If i want to store in row greater than 8060
> then how to do? Is it any possible way? I try with ntext and
sp_tableoption
> but it gives me upto 256.
> And i read in theory BLOB and all but how to use that?
> Thanks in advance.
> Milind
row size in table
Let me say you have a table with three columns
Bookid as integer (4 bytes)
Price as money (8 bytes)
Quantity as bigint (8 bytes)
Total bytes per row=4+8+8= 20 bytes
Now you estimate that your table will have 10000 rows
Number of rows can fit on 8k data page
8060/20=403 rows per page
As I said we have 10000 rows we calculate data pages needed
10000/403=25 data pages
8192*25=204,800 Total bytes needed for the table
204,800/1024=200kb
200/1024=0.1mb
"sunil" <anonymous@.discussions.microsoft.com> wrote in message
news:E76F0F6D-0641-4388-9B2C-D59A596A1EDD@.microsoft.com...
> how to find the size occupied by one row in a table
>
>|||Thanks for the answer, but I want something different i.e, I want to check t
he average space occupied by a table. I've used sp_spaceused but I could not
get the proper result if I create a small tabel say with name char(5) and i
nsert one row even then it
shows data occupied is 16 KB, so can you help me in finding exactly how to f
ind how much data is occupied by a table.
Thanks and Regards
Sunil|||In order to get the correct result ,you will have to run update statistics.
For more details please refer to the BOL.
"Sunil" <anonymous@.discussions.microsoft.com> wrote in message
news:E962D2EF-BFB4-4304-ACEC-578D5E28A50D@.microsoft.com...
> Thanks for the answer, but I want something different i.e, I want to check
the average space occupied by a table. I've used sp_spaceused but I could
not get the proper result if I create a small tabel say with name char(5)
and insert one row even then it shows data occupied is 16 KB, so can you
help me in finding exactly how to find how much data is occupied by a table.
>
> Thanks and Regards
>
> Sunil|||> Thanks for the answer, but I want something different i.e, I want to check
the average space occupied by a table. I've used sp_spaceused but I could
not get the proper result if I create a small tabel say with name char(5)
and insert one row even then it shows data occupied is 16 KB, so can you
help me in finding exactly how to find how much data is occupied by a table.
Exactly 16KB, as sp_spaceused returned. SQL Server allocates 8k pages, you
get one page as soon as you insert first row, and each table has an IAM page
as well. Check the "Physical Database Architecture" chapter in Books OnLine
for details.
Dejan Sarka, SQL Server MVP
Associate Mentor
Solid Quality Learning
More than just Training
www.SolidQualityLearning.com
Row size in SS7
I created a table and got the following:
The total row size (15676) for table 'MyTable' exceeds the maximum number of
bytes per row (8060). Rows that exceed the maximum number of bytes will not
be added.
I have a 5 fields that are set to varchar (2000) plus some others. Should I
use the text data type? I was reading that the text data is not stored in
the table but in a separate page. Will this be a problem in doing searches
and pushing data to the web using stored procedures and ASP?
--
Thanks in advance,
StevenUsing the text datatype won't cause you any problems searching or pushing
data; the data's physical storage is of no concern to you when querying the
data.
Whether or not you SHOULD use it is an architectural question that I can't
answer without more information about what kind of database you're building
and what the columns will be used for.
"Steven K" <skaper@.troop.com> wrote in message
news:O82Zp1XpDHA.2268@.TK2MSFTNGP12.phx.gbl...
> Hello,
> I created a table and got the following:
> The total row size (15676) for table 'MyTable' exceeds the maximum number
of
> bytes per row (8060). Rows that exceed the maximum number of bytes will
not
> be added.
> I have a 5 fields that are set to varchar (2000) plus some others. Should
I
> use the text data type? I was reading that the text data is not stored in
> the table but in a separate page. Will this be a problem in doing
searches
> and pushing data to the web using stored procedures and ASP?
> --
> Thanks in advance,
> Steven
>|||Using varchar datatype you can have a "declared" row length of larger than
8060. As long as the total combined REAL DATA length does not exceed the
limit, you are fine -- with some composite index you may receive a warning.
However, when the real length of data for a record exceeds the limit, you
will have to use text, ntext or image type. Have a look at "Managing ntext,
text, and image Data" in BOL.
"Steven K" <skaper@.troop.com> wrote in message
news:O82Zp1XpDHA.2268@.TK2MSFTNGP12.phx.gbl...
> Hello,
> I created a table and got the following:
> The total row size (15676) for table 'MyTable' exceeds the maximum number
of
> bytes per row (8060). Rows that exceed the maximum number of bytes will
not
> be added.
> I have a 5 fields that are set to varchar (2000) plus some others. Should
I
> use the text data type? I was reading that the text data is not stored in
> the table but in a separate page. Will this be a problem in doing
searches
> and pushing data to the web using stored procedures and ASP?
> --
> Thanks in advance,
> Steven
>sql
Row size in SQL2K
Warning: The table 'PREPARACAO_ATIVIDADE' has been created but its maximum row size (16432) 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.
Is there a way to increase the default maximum row size of 8060 in SQL server 2000?
Thanks for your help,
Andr=E9 Andraus Filho
CREATE TABLE [dbo].[PREPARACAO_ATIVIDADE] (
[COD_PREPARACAO] [varchar] (9) COLLATE SQL_Latin1_General_CP1_CI_AI NOT NULL ,
[CODIGO_USUARIO] [varchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AI NOT NULL ,
[COD_TIP_OBJ] [decimal](18, 0) NOT NULL ,
[COD_UA] [varchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AI NULL ,
[COD_FP] [varchar] (17) COLLATE SQL_Latin1_General_CP1_CI_AI NULL ,
[COD_ATIVIDADE] [decimal](5, 0) NOT NULL ,
[COD_SUBNIVEL_ATIV] [decimal](5, 0) NOT NULL ,
[COD_PLANO] [varchar] (5) COLLATE SQL_Latin1_General_CP1_CI_AI NOT NULL ,
[DATINI_ABRAG] [datetime] NOT NULL ,
[DATFIM_ABRAG] [datetime] NOT NULL ,
[CUSTO_PREV_TRANSP] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AI NULL ,
[DATINI_PREP_ATIV] [datetime] NULL ,
[DATINI_PREVISAO] [datetime] NULL ,
[CUSTO_PREV_DIARIA] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AI NULL ,
[COMENTARIO_DIRETOR] [varchar] (8000) COLLATE SQL_Latin1_General_CP1_CI_AI NULL ,
[DATFIM_PREVISAO] [datetime] NULL ,
[CENTRO_RESPONSAVEL] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AI NULL ,
[SIT_DIR_CENTRO] [decimal](1, 0) NULL ,
[JUSTIF_PONTO] [varchar] (8000) COLLATE SQL_Latin1_General_CP1_CI_AI NULL ,
[SIT_DCI_G] [decimal](1, 0) NULL ,
[COD_CENTRO_RESP_ATIV] [varchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AI NULL ,
[COD_CONSIG] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AI NULL ,
[OUTROS] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AI NULL ) ON [PRIMARY]
GOYou can't make it larger than 8060 bytes but you can change some of the
varchar(8000)'t to Text datatypes.
--
Andrew J. Kelly
SQL Server MVP
"André Andraus Filho" <aafandraus@.fazenda.sp.gov.br> wrote in message
news:074f01c3b057$0dd5bae0$a001280a@.phx.gbl...
I was trying to create the table below with Query Analyzer
and got this warning:
Warning: The table 'PREPARACAO_ATIVIDADE' has been created
but its maximum row size (16432) 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.
Is there a way to increase the default maximum row size
of 8060 in SQL server 2000?
Thanks for your help,
André Andraus Filho
CREATE TABLE [dbo].[PREPARACAO_ATIVIDADE] (
[COD_PREPARACAO] [varchar] (9) COLLATE
SQL_Latin1_General_CP1_CI_AI NOT NULL ,
[CODIGO_USUARIO] [varchar] (11) COLLATE
SQL_Latin1_General_CP1_CI_AI NOT NULL ,
[COD_TIP_OBJ] [decimal](18, 0) NOT NULL ,
[COD_UA] [varchar] (6) COLLATE
SQL_Latin1_General_CP1_CI_AI NULL ,
[COD_FP] [varchar] (17) COLLATE
SQL_Latin1_General_CP1_CI_AI NULL ,
[COD_ATIVIDADE] [decimal](5, 0) NOT NULL ,
[COD_SUBNIVEL_ATIV] [decimal](5, 0) NOT NULL ,
[COD_PLANO] [varchar] (5) COLLATE
SQL_Latin1_General_CP1_CI_AI NOT NULL ,
[DATINI_ABRAG] [datetime] NOT NULL ,
[DATFIM_ABRAG] [datetime] NOT NULL ,
[CUSTO_PREV_TRANSP] [varchar] (20) COLLATE
SQL_Latin1_General_CP1_CI_AI NULL ,
[DATINI_PREP_ATIV] [datetime] NULL ,
[DATINI_PREVISAO] [datetime] NULL ,
[CUSTO_PREV_DIARIA] [varchar] (20) COLLATE
SQL_Latin1_General_CP1_CI_AI NULL ,
[COMENTARIO_DIRETOR] [varchar] (8000) COLLATE
SQL_Latin1_General_CP1_CI_AI NULL ,
[DATFIM_PREVISAO] [datetime] NULL ,
[CENTRO_RESPONSAVEL] [varchar] (100) COLLATE
SQL_Latin1_General_CP1_CI_AI NULL ,
[SIT_DIR_CENTRO] [decimal](1, 0) NULL ,
[JUSTIF_PONTO] [varchar] (8000) COLLATE
SQL_Latin1_General_CP1_CI_AI NULL ,
[SIT_DCI_G] [decimal](1, 0) NULL ,
[COD_CENTRO_RESP_ATIV] [varchar] (6) COLLATE
SQL_Latin1_General_CP1_CI_AI NULL ,
[COD_CONSIG] [varchar] (20) COLLATE
SQL_Latin1_General_CP1_CI_AI NULL ,
[OUTROS] [varchar] (100) COLLATE
SQL_Latin1_General_CP1_CI_AI NULL
) ON [PRIMARY]
GO|||Telling you to change the datatype in order to avoid the error may be a
short term fix but not a complete answer. I would contact them again and
find out when they intend to provide a hot fix to really solve your problem.
--
Andrew J. Kelly
SQL Server MVP
"André A. Filho" <aafandraus@.fazenda.sp.gov.br> wrote in message
news:03e701c3b281$45c3efe0$a001280a@.phx.gbl...
I had already done the change of all varchar(8000) to text
datatype , but it doesn´t resolve , because with this , I
got an Access Violation error when trying to update a text
column inside a stored procedure.
I´ve contacted Microsoft and they told me to change the
datatype in order to solve this AV error.
The columns that are set to varchar(8000) are reports
entered by the user , about requests and contracts.
They are free text with at least 4200 bytes.
Do you have any idea on how to solve it ?
Thanks in advance,
André
>--Original Message--
>You can't make it larger than 8060 bytes but you can
change some of the
>varchar(8000)'t to Text datatypes.
>--
>Andrew J. Kelly
>SQL Server MVP
>
>"André Andraus Filho" <aafandraus@.fazenda.sp.gov.br>
wrote in message
>news:074f01c3b057$0dd5bae0$a001280a@.phx.gbl...
>I was trying to create the table below with Query Analyzer
>and got this warning:
>Warning: The table 'PREPARACAO_ATIVIDADE' has been created
>but its maximum row size (16432) 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.
>Is there a way to increase the default maximum row size
>of 8060 in SQL server 2000?
>Thanks for your help,
>André Andraus Filho
>
>CREATE TABLE [dbo].[PREPARACAO_ATIVIDADE] (
>[COD_PREPARACAO] [varchar] (9) COLLATE
>SQL_Latin1_General_CP1_CI_AI NOT NULL ,
>[CODIGO_USUARIO] [varchar] (11) COLLATE
>SQL_Latin1_General_CP1_CI_AI NOT NULL ,
>[COD_TIP_OBJ] [decimal](18, 0) NOT NULL ,
>[COD_UA] [varchar] (6) COLLATE
>SQL_Latin1_General_CP1_CI_AI NULL ,
>[COD_FP] [varchar] (17) COLLATE
>SQL_Latin1_General_CP1_CI_AI NULL ,
>[COD_ATIVIDADE] [decimal](5, 0) NOT NULL ,
>[COD_SUBNIVEL_ATIV] [decimal](5, 0) NOT NULL ,
>[COD_PLANO] [varchar] (5) COLLATE
>SQL_Latin1_General_CP1_CI_AI NOT NULL ,
>[DATINI_ABRAG] [datetime] NOT NULL ,
>[DATFIM_ABRAG] [datetime] NOT NULL ,
>[CUSTO_PREV_TRANSP] [varchar] (20) COLLATE
>SQL_Latin1_General_CP1_CI_AI NULL ,
>[DATINI_PREP_ATIV] [datetime] NULL ,
>[DATINI_PREVISAO] [datetime] NULL ,
>[CUSTO_PREV_DIARIA] [varchar] (20) COLLATE
>SQL_Latin1_General_CP1_CI_AI NULL ,
>[COMENTARIO_DIRETOR] [varchar] (8000) COLLATE
>SQL_Latin1_General_CP1_CI_AI NULL ,
>[DATFIM_PREVISAO] [datetime] NULL ,
>[CENTRO_RESPONSAVEL] [varchar] (100) COLLATE
>SQL_Latin1_General_CP1_CI_AI NULL ,
>[SIT_DIR_CENTRO] [decimal](1, 0) NULL ,
>[JUSTIF_PONTO] [varchar] (8000) COLLATE
>SQL_Latin1_General_CP1_CI_AI NULL ,
>[SIT_DCI_G] [decimal](1, 0) NULL ,
>[COD_CENTRO_RESP_ATIV] [varchar] (6) COLLATE
>SQL_Latin1_General_CP1_CI_AI NULL ,
>[COD_CONSIG] [varchar] (20) COLLATE
>SQL_Latin1_General_CP1_CI_AI NULL ,
>[OUTROS] [varchar] (100) COLLATE
>SQL_Latin1_General_CP1_CI_AI NULL
>) ON [PRIMARY]
>GO
>
>
>
>.
>
Row Size Exceeds - Help!
Can any one of you tell why the below warning message
appears. I have found this when i created a table. Also I
would like to know what are the side effects on this table
& DB, because of this warning.
Warning: The table 'RawMailList' has been created but its
maximum row size (13415) 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.
Best Regards
ThirumalSQL Server has a MAX row length of 8060 bytes. You can define a table that
exceeds this as you have done but should you UPDATE/INSERT and go over 8060
bytes in total then that INSERT/UPDATE will fail.
Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org
"Thirumal" <treddym@.hotmail.com> wrote in message
news:05c701c33eda$39f0a250$a301280a@.phx.gbl...
> Hi ,
> Can any one of you tell why the below warning message
> appears. I have found this when i created a table. Also I
> would like to know what are the side effects on this table
> & DB, because of this warning.
> Warning: The table 'RawMailList' has been created but its
> maximum row size (13415) 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.
> Best Regards
> Thirumal|||Thirumal,
You probably have several variable-length columns--type varchar() or
nvarchar(), in each row. For example, if you have three varchar(8000)
columns in a single row, they could account for 24,000 bytes of data in
that row if each contained an 8000-byte string. So long as all the data
in any single row does not exceed 8060 bytes, there won't be a problem,
but if you tried to update the varchar() strings to the point where the row
would contain more than 8060 bytes in all, you would get an error.
The warning is just that, a warning. There is no problem at all so long
as you keep each complete row of the table within the 8060 byte limit.
By the way, the reason for this restriction is that SQL Server uses data
pages of 8K bytes (8192 bytes), and the architecture does not allow a
row to span more than one data page. 8060 bytes of data, together with
the additional information that must be on a data page, fits on one 8K page.
More information simply doesn't fit.
Steve Kass
Drew University
Thirumal wrote:
>Hi ,
>Can any one of you tell why the below warning message
>appears. I have found this when i created a table. Also I
>would like to know what are the side effects on this table
>& DB, because of this warning.
>Warning: The table 'RawMailList' has been created but its
>maximum row size (13415) 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.
>Best Regards
>Thirumal
>|||Hi Allan and Steve,
Thanks a ton for clearing my doubts!!
Warm Regards
Thirumal
>--Original Message--
>Thirumal,
> You probably have several variable-length columns--type
varchar() or
>nvarchar(), in each row. For example, if you have three
varchar(8000)
>columns in a single row, they could account for 24,000
bytes of data in
>that row if each contained an 8000-byte string. So long
as all the data
>in any single row does not exceed 8060 bytes, there won't
be a problem,
>but if you tried to update the varchar() strings to the
point where the row
>would contain more than 8060 bytes in all, you would get
an error.
> The warning is just that, a warning. There is no
problem at all so long
>as you keep each complete row of the table within the
8060 byte limit.
> By the way, the reason for this restriction is that SQL
Server uses data
>pages of 8K bytes (8192 bytes), and the architecture does
not allow a
>row to span more than one data page. 8060 bytes of data,
together with
>the additional information that must be on a data page,
fits on one 8K page.
>More information simply doesn't fit.
>Steve Kass
>Drew University
>Thirumal wrote:
>>Hi ,
>>Can any one of you tell why the below warning message
>>appears. I have found this when i created a table. Also
I
>>would like to know what are the side effects on this
table
>>& DB, because of this warning.
>>Warning: The table 'RawMailList' has been created but
its
>>maximum row size (13415) 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.
>>Best Regards
>>Thirumal
>>
>.
>
row size
(SBS2003)
For some reason (my app have been running fine for a couple of months) My
users are getting teh following error when trying to update certain records.
"Can not create a row size of 8436 which is greater than the allowable
maximum of 8060"
What's the deal? How can I fix this?
"johnfli" <john@.here.com> wrote in message
news:OwIiWMp7EHA.936@.TK2MSFTNGP12.phx.gbl...
> I have a vb app that I wrote that saves the info to my SQL database
> (SBS2003)
> For some reason (my app have been running fine for a couple of months) My
> users are getting teh following error when trying to update certain
records.
> "Can not create a row size of 8436 which is greater than the allowable
> maximum of 8060"
> What's the deal? How can I fix this?
You can't. It's an inherent limit of SQL Server.
I'd look at what you're storing. Perhaps you can/need to split the table
into more than one table or move one or more fields to a text field.
>
|||You probably have one or more tables which have varchar columns. The total
lenght of all of the columns in a table can be greater than 8060 as long as
no one actually tries to insert a row which is larger...
For a while no one was adding large rows, now they are...
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"johnfli" <john@.here.com> wrote in message
news:OwIiWMp7EHA.936@.TK2MSFTNGP12.phx.gbl...
> I have a vb app that I wrote that saves the info to my SQL database
> (SBS2003)
> For some reason (my app have been running fine for a couple of months) My
> users are getting teh following error when trying to update certain
records.
> "Can not create a row size of 8436 which is greater than the allowable
> maximum of 8060"
> What's the deal? How can I fix this?
>
row size
More info, please. Table structure, sample data, query that produces the
error?
http://www.aspfaq.com/5006
http://www.aspfaq.com/
(Reverse address to reply.)
"GC" <GC@.discussions.microsoft.com> wrote in message
news:B437E20D-A6E1-485D-8C71-0188D73965DB@.microsoft.com...
> Cannot sort a row of size 8174, which is greater than the allowable
maximum of 8094.
sql
row size
(SBS2003)
For some reason (my app have been running fine for a couple of months) My
users are getting teh following error when trying to update certain records.
"Can not create a row size of 8436 which is greater than the allowable
maximum of 8060"
What's the deal? How can I fix this'"johnfli" <john@.here.com> wrote in message
news:OwIiWMp7EHA.936@.TK2MSFTNGP12.phx.gbl...
> I have a vb app that I wrote that saves the info to my SQL database
> (SBS2003)
> For some reason (my app have been running fine for a couple of months) My
> users are getting teh following error when trying to update certain
records.
> "Can not create a row size of 8436 which is greater than the allowable
> maximum of 8060"
> What's the deal? How can I fix this'
You can't. It's an inherent limit of SQL Server.
I'd look at what you're storing. Perhaps you can/need to split the table
into more than one table or move one or more fields to a text field.
>|||You probably have one or more tables which have varchar columns. The total
lenght of all of the columns in a table can be greater than 8060 as long as
no one actually tries to insert a row which is larger...
For a while no one was adding large rows, now they are...
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"johnfli" <john@.here.com> wrote in message
news:OwIiWMp7EHA.936@.TK2MSFTNGP12.phx.gbl...
> I have a vb app that I wrote that saves the info to my SQL database
> (SBS2003)
> For some reason (my app have been running fine for a couple of months) My
> users are getting teh following error when trying to update certain
records.
> "Can not create a row size of 8436 which is greater than the allowable
> maximum of 8060"
> What's the deal? How can I fix this'
>
row size
of 8094.More info, please. Table structure, sample data, query that produces the
error?
http://www.aspfaq.com/5006
http://www.aspfaq.com/
(Reverse address to reply.)
"GC" <GC@.discussions.microsoft.com> wrote in message
news:B437E20D-A6E1-485D-8C71-0188D73965DB@.microsoft.com...
> Cannot sort a row of size 8174, which is greater than the allowable
maximum of 8094.
row size
(SBS2003)
For some reason (my app have been running fine for a couple of months) My
users are getting teh following error when trying to update certain records.
"Can not create a row size of 8436 which is greater than the allowable
maximum of 8060"
What's the deal? How can I fix this'"johnfli" <john@.here.com> wrote in message
news:OwIiWMp7EHA.936@.TK2MSFTNGP12.phx.gbl...
> I have a vb app that I wrote that saves the info to my SQL database
> (SBS2003)
> For some reason (my app have been running fine for a couple of months) My
> users are getting teh following error when trying to update certain
records.
> "Can not create a row size of 8436 which is greater than the allowable
> maximum of 8060"
> What's the deal? How can I fix this'
You can't. It's an inherent limit of SQL Server.
I'd look at what you're storing. Perhaps you can/need to split the table
into more than one table or move one or more fields to a text field.
>|||You probably have one or more tables which have varchar columns. The total
lenght of all of the columns in a table can be greater than 8060 as long as
no one actually tries to insert a row which is larger...
For a while no one was adding large rows, now they are...
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"johnfli" <john@.here.com> wrote in message
news:OwIiWMp7EHA.936@.TK2MSFTNGP12.phx.gbl...
> I have a vb app that I wrote that saves the info to my SQL database
> (SBS2003)
> For some reason (my app have been running fine for a couple of months) My
> users are getting teh following error when trying to update certain
records.
> "Can not create a row size of 8436 which is greater than the allowable
> maximum of 8060"
> What's the deal? How can I fix this'
>
Tuesday, March 20, 2012
ROW Limit and pages
SO the total size of the combined columns in a table for one row cannot
exceed 8k correct? (Throwing out the TEXT, NCHAR and NTEXT data types)
Thank you in advance!
Mike
On Mon, 22 Nov 2004 12:17:59 -0500, Mike London wrote:
>OK I just need a clarification:
>SO the total size of the combined columns in a table for one row cannot
> exceed 8k correct? (Throwing out the TEXT, NCHAR and NTEXT data types)
>Thank you in advance!
Hi Mike,
NCHAR should be counted in, IMAGE should be thrown out (as well as TEXT
and NTEXT) (but do check out the text in row option).
Best, Hugo
(Remove _NO_ and _SPAM_ to get my e-mail address)
|||Thank you both for that clarification!
Mike London wrote:
> OK I just need a clarification:
> SO the total size of the combined columns in a table for one row cannot
> exceed 8k correct? (Throwing out the TEXT, NCHAR and NTEXT data types)
> Thank you in advance!
> Mike
ROW Limit and pages
SO the total size of the combined columns in a table for one row cannot
exceed 8k correct? (Throwing out the TEXT, NCHAR and NTEXT data types)
Thank you in advance!
MikeYes,
But its 8038
Yours in quibble
Peter
"Do not awake the sleeping dragon for you are crunchy and
taste good with ketchup".
Peter The Spate
>--Original Message--
>OK I just need a clarification:
>SO the total size of the combined columns in a table for
one row cannot
> exceed 8k correct? (Throwing out the TEXT, NCHAR and
NTEXT data types)
>Thank you in advance!
>Mike
>.
>|||On Mon, 22 Nov 2004 12:17:59 -0500, Mike London wrote:
>OK I just need a clarification:
>SO the total size of the combined columns in a table for one row cannot
> exceed 8k correct? (Throwing out the TEXT, NCHAR and NTEXT data types)
>Thank you in advance!
Hi Mike,
NCHAR should be counted in, IMAGE should be thrown out (as well as TEXT
and NTEXT) (but do check out the text in row option).
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)|||Thank you both for that clarification!
Mike London wrote:
> OK I just need a clarification:
> SO the total size of the combined columns in a table for one row cannot
> exceed 8k correct? (Throwing out the TEXT, NCHAR and NTEXT data types)
> Thank you in advance!
> Mike
ROW Limit and pages
SO the total size of the combined columns in a table for one row cannot
exceed 8k correct? (Throwing out the TEXT, NCHAR and NTEXT data types)
Thank you in advance!
MikeOn Mon, 22 Nov 2004 12:17:59 -0500, Mike London wrote:
>OK I just need a clarification:
>SO the total size of the combined columns in a table for one row cannot
> exceed 8k correct? (Throwing out the TEXT, NCHAR and NTEXT data types)
>Thank you in advance!
Hi Mike,
NCHAR should be counted in, IMAGE should be thrown out (as well as TEXT
and NTEXT) (but do check out the text in row option).
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)|||Thank you both for that clarification!
Mike London wrote:
> OK I just need a clarification:
> SO the total size of the combined columns in a table for one row cannot
> exceed 8k correct? (Throwing out the TEXT, NCHAR and NTEXT data types)
> Thank you in advance!
> Mike