SQL 2008 R2 Row size limit exceeded -


i have sql 2008 r2 database. created table , when trying execute select statement (with order clause) against it, receive error "cannot create row of size 8870 greater allowable maximum row size of 8060."

i able select data without order clause, order clause important , require it. have tried robust plan option still received same error.

my table has 300+ columns data type text. have tried using varchar , nvarchar, have had no success.

can please provide insight?

update:

thanks comments. agree. 300+ columns in 1 table not design. i'm trying bring excel tabs database data tables. tabs have 300+ columns.

i first use create statement create table based on excel tab columns vary. various select, update, insert, etc statements on table after table created data.

the structure of table follow patter: fkversionid, rownumber(autonumber), field1, field2, field3, etc...

is there way around 8060 row size limit?

you mentioned tried nvarchar , varchar ... remember nvarchar doubles bytes used, 1 of 2 support foreign characters in cases, such accent marks.

varchar choice if can limit maximum size appropriately. 8000 characters still real limit, if on average each varchar column no more 26 characters, you'll okay. go riskier , go varchar , 50char length, on average utilize 26characters per column.. meaning 1 column maybe 36 character length, , next 16character length... okay again. (as long never exceed average of 26characters per column 300 columns.)

obviously dynamic number of fields, , potential way exceed 8000 character limit, doomed sql's specs. other alternative create multiple tables , when access data, have unique key join appropriate records on. in select statement, use join, , multiple tables can handle rows 8000 + 8000 + ...

so doable, have work sql rules.


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -