| Author |
Topic |
|
pelegk2
Aged Yak Warrior
723 Posts |
Posted - 2006-06-05 : 03:01:50
|
| i have tried to insert into an nvarchar (4000) field a string in the size of 3989and i got the message " row exceds maximum size 8088 where max allowed 8068"i checked and verifeid and mystring is 3989!after i cutted the string to 3938 it all worked fineany idea why?(the nvarchar(4000) wasnt defined by me -but by a previous programmer, beacuse i assume in this case - a string of type "34234|324234||454545" a varchar field is enough -which gives 8000 chars instead of 4000)thnaks in advancepelegIsrael -the best place to live in aftr heaven 9but no one wan't to go there so fast -:) |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2006-06-05 : 04:32:32
|
| It's not that string that's the problem it's the max row size which is 8060. The combined size of all the columns in the row is 8088 which is invalid. Dropping the size of that string brought it below the 8060 byte limit.==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
pelegk2
Aged Yak Warrior
723 Posts |
Posted - 2006-06-05 : 05:37:17
|
| u mean for example tha i cant defined 2 column s each of size 4000 for example?Israel -the best place to live in aftr heaven 9but no one wan't to go there so fast -:) |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-06-05 : 07:18:16
|
quote: Originally posted by pelegk2 u mean for example tha i cant defined 2 column s each of size 4000 for example?Israel -the best place to live in aftr heaven 9but no one wan't to go there so fast -:)
Yes. Run thisdeclare @t table(n1 nvarchar(4000), n2 nvarchar(4000))Also read about Maximum Capacity Specifications in sql server help fileMadhivananFailing to plan is Planning to fail |
 |
|
|
pelegk2
Aged Yak Warrior
723 Posts |
Posted - 2006-06-05 : 08:34:23
|
| ok thanks alotIsrael -the best place to live in aftr heaven 9but no one wan't to go there so fast -:) |
 |
|
|
PSamsig
Constraint Violating Yak Guru
384 Posts |
Posted - 2006-06-05 : 10:18:42
|
| You CAN creater a table like table(n1 nvarchar(4000), n2 nvarchar(4000)), but you can't fill both n1 and n2 to the max at the same time.-- This one's tricky. You have to use calculus and imaginary numbers for this. You know, eleventeen, thirty-twelve and all those. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-06-05 : 10:22:38
|
quote: Originally posted by PSamsig You CAN creater a table like table(n1 nvarchar(4000), n2 nvarchar(4000)), but you can't fill both n1 and n2 to the max at the same time.-- This one's tricky. You have to use calculus and imaginary numbers for this. You know, eleventeen, thirty-twelve and all those.
Thanks. Thats what I wanted to tell the questioner MadhivananFailing to plan is Planning to fail |
 |
|
|
PSamsig
Constraint Violating Yak Guru
384 Posts |
Posted - 2006-06-05 : 10:24:15
|
| And yes, if the string '34234|324234||454545' is representative for the type of what you save in your nvarchar coloumn, then there is no reason you reconfigure it to varchar(8000), that would give you twice the max size.-- This one's tricky. You have to use calculus and imaginary numbers for this. You know, eleventeen, thirty-twelve and all those. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
cmdr_skywalker
Posting Yak Master
159 Posts |
Posted - 2006-06-05 : 22:36:41
|
| NVARCHAR is UNICODE VARCHAR. NVARCHAR(4000) is storage equivalent of VARCHAR(8000). As Madhivanan said, check the BOL for Maximum Capacity Specification.May the Almighty God bless us all! |
 |
|
|
|