question

ShambhuRai-4099 avatar image
0 Votes"
ShambhuRai-4099 asked ShambhuRai-4099 commented

failed because the minimum row size would be 8876.

Hi Expert,
I am trying to increase the datatype from nchar(200) to nchar(1000) getting below mentioned error.. is there any way to get rid of this .. varchar max is not accepting certain records so need nchar only

sql-server-generalsql-server-transact-sqlsql-server-integration-services
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

getting below mentioned error

I don't see any error message in your post.
0 Votes 0 ·
ErlandSommarskog avatar image
1 Vote"
ErlandSommarskog answered ShambhuRai-4099 commented

I doubt that you need nchar(1000). Or for that matter nchar(200). Keep in mind that nchar is a fixed length string. nchar(1000) would only make sense if all your column are close to 1000 characters long. But in most string columns, the length varies considerably, so nvarchar(1000) is a better choice.

This also helps you to get around this error. This is because an nchar(1000) value always takes up 2000 bytes, even if it's empty. Whereas an nvarchar(1000) value takes up as many bytes needed to express the value, normally two bytes per character + two bytes for the length.

If you have more overly long nchar columns, you should change these as well.


· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank! your logic is working

0 Votes 0 ·
TomPhillips-1744 avatar image
0 Votes"
TomPhillips-1744 answered

You would need to set it to nvarchar(1000).

What do you mean by "varchar max is not accepting certain records"? varchar and nvarchar are different. Did you mean nvarchar?

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

BertZhoumsft-7490 avatar image
0 Votes"
BertZhoumsft-7490 answered

Hi,@ShambhuRai-4099

If you don't plan to fill all columns with util , you need to use nvarchar (or just varchar) instead of nchar . Because an nchar(1000) needs to reserve 2000 bytes , whether you want to use it or not.

So if you have 1000 characters in each of these columns , it won't work no matter what data type you use . The reason is that the basic storage element in SQL Server is 8K pages .

Usually varchar(max) can be used , but there is a performance overhead if you don't recommend it... Or change the field that produces the erro r, use nvarchar(1000).

please refer to this link.

Best regards,
Bert Zhou


If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.