Monday, March 19, 2012

Cannot write a small row! Please help...

Hi everyone,
This is weird. Please help!
I have a long row in the form:
WordA WordB WordC WordD etc...
The above row is 5,294 bytes in size.
I got the soundex equivalent of this row. It now became:
SoundexA SoundexB SoundexC SoundexD etc...
It's size is now 2,898 bytes. AS you would expect as soundex returns a
4 letter code.
I attempt to write the soundex field to its place in the database. I
get the followign error message:
Cannot create a row of size 9602 which is greater than the allowable
maximum of 8060.
The statement has been terminated.
Now, I am totally confused - Does anyone know why this is happening?
Any ideas/suggestions/comments/diagnostics that I could run would be
great. Please help me!
Confused,
Al.Could it be that your possible row size is exceeded ? Not the actual
used one, but the highest possible. Therefore you should have gotten an
error while creating or altering the table once upon a time.
SELECT Sum(ISNULL(CHARACTER_MAXIMUM_LENGTH,length)) from
INFORMATION_SCHEMA.Columns col
INNER join systypes
on systypes.name = col.Data_type
Where table_name = 'YourTable'
HTH, jens Suessmeyer.|||Thanks jens,
I ran this cool command on my table and get the answer: 8392
Unfortunately I don't know where it is! Can you help me locate it or
suggest possible solutions? Can you recommend what I should do please?
Any assistance much appreciated.
Thank you,
Al.|||Sure, you should narrow down your datatypes that these fit on a
datapage of 8060 bytes. In some cases some columns use wasted datatypes
as somebody just assumes how many bytes are to go in that column. If
there is in some cases reengineering,l the people narrow down the
datatypes because they know the actual data size of the columns later.
Or you can split out the table to some "Soundex table" qwhich
references 1by1 the original table and just point with the same PK on
this.
HTH, jens Suessmeyer.

No comments:

Post a Comment