Solved

MS SQL: Cannot sort a row of size 8096, which is greater than the allowable maximum of 8094

Posted on 2009-07-05
2
1,078 Views
Last Modified: 2012-05-07
SQL 2K:

I changed datatype of ItemDescription nvarchar to varchar (4000). I m using Inner Join Query Where I have to use
"Select t1.Itemdesction , t2.ItemDescription, t3.ItemDescription from ItemMaster....".

 I am getting error

" Cannot sort a row of size 8096, which is greater than the allowable maximum of 8094"

I tried to change datatype back to nvarchar , its giving error while saving :

'ItemMaster' table
- Unable to modify table.  
ODBC error: [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot create a row of size 9517 which is greater than the allowable maximum of 8060.
[Microsoft][ODBC SQL Server Driver][SQL Server]The statement has been terminated.
0
Comment
Question by:Harsh08
2 Comments
 
LVL 39

Expert Comment

by:Pratima Pharande
ID: 24782789
change it to text data type


It looks like you have too much data in the row already.
What is the total size of the other columns?
SQL Server will allow you to define a column of a variable length size, that
could end up leading to errors on insert or update.

For example, you could create a table that has 10 varchar(8000) columns,
with no error.
But if you tried to insert 8000 bytes into 2 of those columns, you would get
an error.

The only way in SQL 2000 to have more than 8060 bytes in a row is to use the
text data type.
0
 
LVL 57

Accepted Solution

by:
Raja Jegan R earned 500 total points
ID: 24783008
Check out the solutions given earlier in EE itself:

http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/Q_11173651.html

Hope this helps
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
migration MS SQL database to Oracle 30 59
Sql Stored Procedure 65 26
SqlServer no dupes 25 34
transaction in asp.net, sql server 6 31
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

806 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question