I have a strange error in one of the query that I am doing. And, I am un-sure on how to resolve it. Here is the query :
SELECT o.name, c.number, c.colid, c.text
INNER JOIN sysobjects o ON c.id = o.id
(o.xtype = 'P') AND (
(c.text LIKE '%a%')
(o.name like '%a%')
Error Message :
Server: Msg 1540, Level 16, State1, Line 3
Cannot sort a row of size 8096, which is greater than the allowable maximum of 8094.
As far as i know, name seen to be of the type sysname, number is of type int and colid is also of type int. Those three togheter, if they are put together, can't go over the 8094 limit. I know that the biggest row is the text, length of 4k, yet, does SQL server take that row in consideration when he sort? Even though it is not specify inside the ORDER BY clause?
I might be missing something somewhere or maybe not. Tell me if you need more detail to help me solve or avoid this kind of error.