Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


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

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 70

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Viewers will learn how the fundamental information of how to create a table.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Suggested Courses

577 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