I'm trying to rebuild a clustered index on a SQL Server 2005 table, and I keep getting the error:
Cannot create a row of size 8078 which is greater than the allowable maximum of 8060.
The command is just a standard ALTER INDEX <name> ON <table> REBUILD
.
I have no idea how I've managed to get 8078 bytes into a single row - from my understanding of SQL, that shouldn't be possible.
If I do a query to check how much data there is in the rows (ie Datalength(col1)+datalength(col2) ...) then the largest row in the table appears to be 6389 bytes, which is fine in relation to the 8060 limit.
I've tried copying the table (using Import Export Wizard) to another database or another server and I get the same errors about an 8078-byte row.