Strange behaviour of row limit error

  • here is a simple query

    select * , ROW_NUMBER() over(ORDER BY Addr_city, Comp_CompanyId) AS rowranking

    from sagecrm.vSearchListCompany

    WHERE comp_name LIKE N'us army%' ESCAPE '|'

    and here is a simple error that i am getting when i ran the above query.

    Cannot create a row of size 8094 which is greater than the allowable maximum of 8060.

    but when i use a different column in the order by clause the query works e.g

    select * , ROW_NUMBER() over(ORDER BY Pers_fullname, Comp_CompanyId) AS rowranking

    from sagecrm.vSearchListCompany

    WHERE comp_name LIKE N'us army%' ESCAPE '|'

    i undestand the error but i dont know why i am getting this, and more importantly why i am not getting it for the second case.

    Any help??

    Thanks

    Usman

  • Where are the gurus??:)

  • Can you post some data structures and sample data that would allow us to experiment with the data?

    What are the data types and sizes involved? Are any varchar or nvarchar(max)?

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply