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

I am running a the following query against a database of contacts:
SELECT *
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?
ccleebeltPresidentAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

RiverGuyCommented:
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?  
0
arbertCommented:
You're doing a "Select *"  do you really need to select every column?  Are you using all fields in the select clause?

Brett
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Scott PletcherSenior DBACommented:
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.

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.