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

Posted on 2003-03-13
Medium Priority
Last Modified: 2012-05-04
I am running a the following query against a database of contacts:
FROM vw_hr_candidates
WHERE (contact_status = 1)
ORDER BY contact_last_name, contact_first_name

I get the following error.
Microsoft OLE DB Provider for SQL Server error '80040e14'
Cannot sort a row of size 8183, which is greater than the allowable maximum of 8094.
/hr/candidate_list.asp, line 45

contact_id = int
contact_last_name = varchar(100)
contact_first_name = varchar(100)

I have 9933 rows of data in this table.  How can I get SQL server to not fail when trying to sort?  Do I need to create an index for those fields (contact_last_name & contact_first_name)?

What can I do?
Question by:ccleebelt
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 8129039
I believe its talking about the amount of data for each row.  The column lengths would have make that up.  Do you have any fixed-length fields that you can decrease the size of?  
LVL 34

Accepted Solution

arbert earned 600 total points
ID: 8129078
You're doing a "Select *"  do you really need to select every column?  Are you using all fields in the select clause?

LVL 69

Expert Comment

by:Scott Pletcher
ID: 8129259
Yes, do something like this:

SELECT contact_id, contact_last_name, ontact_first_name
FROM vw_hr_candidates
WHERE (contact_status = 1)
ORDER BY contact_last_name, contact_first_name

If those are the only columns you need from the table.


Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.
Suggested Courses

752 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