venkataramanaiahsr
asked on
Updation Error
i am trying to update thro ado recordset . i am getting the following error
"cannot create a row size of 13194 which is greater than allowable max size of 8060 in sql server 2000"
all field lengths is 500 chars, the length of data which are getting updated is less than 400chars
Pls let us know the cause and remedy for the same
Regards
Venkat
>all field lengths is 500 chars, the length of data which are getting updated is less than 400chars
you probably have each field less than 400 chars, but the total of all the columns benig larger
now, if you use CHAR() instead of VARCHAR(), you will indeed store for each column 500 bytes, and not only the amount of data you think you store.
if you have CHAR() data type, change to VARCHAR().
if the total defined row size is >8060 bytes, you have to split the table into 2 parts
you probably have each field less than 400 chars, but the total of all the columns benig larger
now, if you use CHAR() instead of VARCHAR(), you will indeed store for each column 500 bytes, and not only the amount of data you think you store.
if you have CHAR() data type, change to VARCHAR().
if the total defined row size is >8060 bytes, you have to split the table into 2 parts
ASKER
TranID int 4 0
0 CathNo int 4 0
0 CaseID int 4 0
0 DoP varchar 8 0
0 ReportType varchar 25 1
0 Intervention nvarchar 500 1
0 Indication nvarchar 500 1
0 LC_Lesion varchar 500 1
0 LC_Type varchar 500 1
0 LC_Length varchar 500 1
0 LC_Calcification varchar 500 1
0 LC_InvolvingBranch varchar 500 1
0 LC_Thrombus varchar 500 1
0 LC_Size varchar 500 1
0 LC_Flow varchar 500 1
0 LC_Balloon varchar 500 1
0 LC_Wire varchar 500 1
0 LC_GuidingCatheter varchar 500 1
0 IP_NoOfInflation varchar 500 1
0 IP_Pressure varchar 500 1
0 IP_Duration varchar 500 1
0 SD_Indication varchar 500 1
0 SD_Type varchar 500 1
0 SD_MaxPressure varchar 500 1
0 SD_Duration varchar 500 1
0 SD_NoOfInflation varchar 500 1
0 SD_ResidualStenosis varchar 500 1
0 SD_Result varchar 500 1
0 Remarks varchar 500 1
0 Cardiologist1 varchar 25 1
0 Cardiologist2 varchar 25 1
0 Cardiologist3 varchar 25 1
0 NoOfColumns smallint 2 1
0 Finalized bit 1
The above structure does not work . i am getting the above error
where as the below mentioned structure is working fine
3 Caseid int 4 0
0 FDiag1 varchar 500 0
0 FDiag2 varchar 500 0
0 FDiag3 varchar 500 0
0 FDiag4 varchar 260 0
0 FDiag5 varchar 260 0
0 FDiag6 varchar 260 0
0 FDiag7 varchar 260 0
0 Fdiag8 varchar 260 0
0 Fdiag9 varchar 260 0
0 Fdiag10 varchar 260 0
0 History varchar 2000 0
0 OnExamination varchar 2000 0
0 PulseRate varchar 150 0
0 BP varchar 150 0
0 JVP varchar 150 0
0 CVS varchar 150 0
0 RS varchar 150 0
0 PA varchar 150 0
0 CNS varchar 150 0
0 Investigations varchar 100 0
0 CourseinHospital varchar 2500 0
0 Adviceondischarge varchar 2000 0
0 Remarks varchar 1000 0
0 Authorize bit 1 0
0 EnteredbyCode int 4 0
0 EnteredbyName varchar 50 0
0 EnteredbyDesig varchar 50 0
0 Authorizedbycode int 4 0
0 AuthorizedbyName varchar 50 0
0 AuthorizedbyDesig varchar 50 0
0 Finalyzedbycode int 4 0
0 FinalyzedbyName varchar 50 0
0 FinalyzedbyDesig varchar 50 0
0 Prescription varchar 10 0
0 DoD varchar 8 0
0 ToD varchar 4 0
0 DsTypecode int 4 1
0 DsType varchar 50 1
0 concurrencyid int 4 0
0 CathNo int 4 0
0 CaseID int 4 0
0 DoP varchar 8 0
0 ReportType varchar 25 1
0 Intervention nvarchar 500 1
0 Indication nvarchar 500 1
0 LC_Lesion varchar 500 1
0 LC_Type varchar 500 1
0 LC_Length varchar 500 1
0 LC_Calcification varchar 500 1
0 LC_InvolvingBranch varchar 500 1
0 LC_Thrombus varchar 500 1
0 LC_Size varchar 500 1
0 LC_Flow varchar 500 1
0 LC_Balloon varchar 500 1
0 LC_Wire varchar 500 1
0 LC_GuidingCatheter varchar 500 1
0 IP_NoOfInflation varchar 500 1
0 IP_Pressure varchar 500 1
0 IP_Duration varchar 500 1
0 SD_Indication varchar 500 1
0 SD_Type varchar 500 1
0 SD_MaxPressure varchar 500 1
0 SD_Duration varchar 500 1
0 SD_NoOfInflation varchar 500 1
0 SD_ResidualStenosis varchar 500 1
0 SD_Result varchar 500 1
0 Remarks varchar 500 1
0 Cardiologist1 varchar 25 1
0 Cardiologist2 varchar 25 1
0 Cardiologist3 varchar 25 1
0 NoOfColumns smallint 2 1
0 Finalized bit 1
The above structure does not work . i am getting the above error
where as the below mentioned structure is working fine
3 Caseid int 4 0
0 FDiag1 varchar 500 0
0 FDiag2 varchar 500 0
0 FDiag3 varchar 500 0
0 FDiag4 varchar 260 0
0 FDiag5 varchar 260 0
0 FDiag6 varchar 260 0
0 FDiag7 varchar 260 0
0 Fdiag8 varchar 260 0
0 Fdiag9 varchar 260 0
0 Fdiag10 varchar 260 0
0 History varchar 2000 0
0 OnExamination varchar 2000 0
0 PulseRate varchar 150 0
0 BP varchar 150 0
0 JVP varchar 150 0
0 CVS varchar 150 0
0 RS varchar 150 0
0 PA varchar 150 0
0 CNS varchar 150 0
0 Investigations varchar 100 0
0 CourseinHospital varchar 2500 0
0 Adviceondischarge varchar 2000 0
0 Remarks varchar 1000 0
0 Authorize bit 1 0
0 EnteredbyCode int 4 0
0 EnteredbyName varchar 50 0
0 EnteredbyDesig varchar 50 0
0 Authorizedbycode int 4 0
0 AuthorizedbyName varchar 50 0
0 AuthorizedbyDesig varchar 50 0
0 Finalyzedbycode int 4 0
0 FinalyzedbyName varchar 50 0
0 FinalyzedbyDesig varchar 50 0
0 Prescription varchar 10 0
0 DoD varchar 8 0
0 ToD varchar 4 0
0 DsTypecode int 4 1
0 DsType varchar 50 1
0 concurrencyid int 4 0
The first thing I would look at wuold be to split non-specific data off to a different table, and link in with an ID, normalising your data structure.
For example:
Create a table called cardiologist where you store the cardiologists information
tblCardiologist
CardioID int idendity(1,1)
CardioDescription varchar(25)
And then on the other table change
0 Cardiologist1 int
0 Cardiologist2 int
0 Cardiologist3 int
And then simply store the ID of the cardiologists in there - You should also create a foreign key to enforce referential integrity. This alone will knock off 60 odd bytes from your row size.
Another good candidate would be the data that you have logically grouped (not really knowing the data it is a little difficult, but)
TransactionSD
SDID int
SD_Indication varchar 500
SD_Type varchar 500
SD_MaxPressure varchar 500
SD_Duration varchar 500
SD_NoOfInflation varchar 500
SD_ResidualStenosis varchar 500
SD_Result varchar 500
And then removing all those columns from the Trans table and replacing with a single column
SDID int
to link to the relevant TransactionSD row.
This would knock another 3,500 odd bytes off your row size.
True, it makes the reporting a little more complex (you have to use joins), but not impossibly so.
Hope this gives you a good idea of how to go about this (you can do the same for IP... and LD ...)
Cheers
Night
For example:
Create a table called cardiologist where you store the cardiologists information
tblCardiologist
CardioID int idendity(1,1)
CardioDescription varchar(25)
And then on the other table change
0 Cardiologist1 int
0 Cardiologist2 int
0 Cardiologist3 int
And then simply store the ID of the cardiologists in there - You should also create a foreign key to enforce referential integrity. This alone will knock off 60 odd bytes from your row size.
Another good candidate would be the data that you have logically grouped (not really knowing the data it is a little difficult, but)
TransactionSD
SDID int
SD_Indication varchar 500
SD_Type varchar 500
SD_MaxPressure varchar 500
SD_Duration varchar 500
SD_NoOfInflation varchar 500
SD_ResidualStenosis varchar 500
SD_Result varchar 500
And then removing all those columns from the Trans table and replacing with a single column
SDID int
to link to the relevant TransactionSD row.
This would knock another 3,500 odd bytes off your row size.
True, it makes the reporting a little more complex (you have to use joins), but not impossibly so.
Hope this gives you a good idea of how to go about this (you can do the same for IP... and LD ...)
Cheers
Night
As I said, I don't know your data - it is possible that you want to link on the CaseID instead of the TranID, but I think you get the idea.
ASKER
I Got your point but what is puzzling me is with the following table , i am not getting any update error .
on first look, the size of the table row > the size of the table row in the table on which i am getting update error
am i missing something here?????????. Pls getback as it is very urgent
3 Caseid int 4 0
0 FDiag1 varchar 500 0
0 FDiag2 varchar 500 0
0 FDiag3 varchar 500 0
0 FDiag4 varchar 260 0
0 FDiag5 varchar 260 0
0 FDiag6 varchar 260 0
0 FDiag7 varchar 260 0
0 Fdiag8 varchar 260 0
0 Fdiag9 varchar 260 0
0 Fdiag10 varchar 260 0
0 History varchar 2000 0
0 OnExamination varchar 2000 0
0 PulseRate varchar 150 0
0 BP varchar 150 0
0 JVP varchar 150 0
0 CVS varchar 150 0
0 RS varchar 150 0
0 PA varchar 150 0
0 CNS varchar 150 0
0 Investigations varchar 100 0
0 CourseinHospital varchar 2500 0
0 Adviceondischarge varchar 2000 0
0 Remarks varchar 1000 0
0 Authorize bit 1 0
0 EnteredbyCode int 4 0
0 EnteredbyName varchar 50 0
0 EnteredbyDesig varchar 50 0
0 Authorizedbycode int 4 0
0 AuthorizedbyName varchar 50 0
0 AuthorizedbyDesig varchar 50 0
0 Finalyzedbycode int 4 0
0 FinalyzedbyName varchar 50 0
0 FinalyzedbyDesig varchar 50 0
0 Prescription varchar 10 0
0 DoD varchar 8 0
0 ToD varchar 4 0
0 DsTypecode int 4 1
0 DsType varchar 50 1
0 concurrencyid int 4 0
on first look, the size of the table row > the size of the table row in the table on which i am getting update error
am i missing something here?????????. Pls getback as it is very urgent
3 Caseid int 4 0
0 FDiag1 varchar 500 0
0 FDiag2 varchar 500 0
0 FDiag3 varchar 500 0
0 FDiag4 varchar 260 0
0 FDiag5 varchar 260 0
0 FDiag6 varchar 260 0
0 FDiag7 varchar 260 0
0 Fdiag8 varchar 260 0
0 Fdiag9 varchar 260 0
0 Fdiag10 varchar 260 0
0 History varchar 2000 0
0 OnExamination varchar 2000 0
0 PulseRate varchar 150 0
0 BP varchar 150 0
0 JVP varchar 150 0
0 CVS varchar 150 0
0 RS varchar 150 0
0 PA varchar 150 0
0 CNS varchar 150 0
0 Investigations varchar 100 0
0 CourseinHospital varchar 2500 0
0 Adviceondischarge varchar 2000 0
0 Remarks varchar 1000 0
0 Authorize bit 1 0
0 EnteredbyCode int 4 0
0 EnteredbyName varchar 50 0
0 EnteredbyDesig varchar 50 0
0 Authorizedbycode int 4 0
0 AuthorizedbyName varchar 50 0
0 AuthorizedbyDesig varchar 50 0
0 Finalyzedbycode int 4 0
0 FinalyzedbyName varchar 50 0
0 FinalyzedbyDesig varchar 50 0
0 Prescription varchar 10 0
0 DoD varchar 8 0
0 ToD varchar 4 0
0 DsTypecode int 4 1
0 DsType varchar 50 1
0 concurrencyid int 4 0
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for your suggestion. we just trimmed the fields at the time of updation and is working fine
HOWEVER, You can consider changing your table design and breaking the single row on a table up into multiple tables, referenced by a constraint. (this is generally considered best practice anyway). Please post you table structure here and we can have a look at it and advise.