I have a view with 998 columns*, and running a SELECT A.* FROM
this view works, albeit relatively slowly (i.e. SELECT A.* FROM [MyView] A
).
When I run a second query that returns the same columns but joining to a separate table to filter some rows out, I get the error message:
Cannot create a row of size 8061 which is greater than the allowable maximum row size of 8060.
This is the query that throws the error:
SELECT
A.HOSPITAL_NAME
FROM
HReportBuilderView A
JOIN
HospitalNameLookup B ON A.DEFINITIVE_ID = B.HOSPITAL_ID
Admittedly, my knowledge on bytes is shallow, but I suppose my question is: if the number of columns/columns themselves are identical, why is this throwing an error message when a simple select * from that view does not?
* Believe it or not, there is an actual business reason to have a view of 998 columns, so hopefully the stack overflow community will cut me some slack.