Monday, March 19, 2012

Maximum size for "ntext" type in sql server

I couldn't insert more than 4000 charachters in "ntext" type in SQL server. Is there anyway, i can increase the size or any suggestions?ntext columns are limited to 2GB? Sounds like how you are setting the ntext is limited to 4000 characters, not the column itself.|||I am using NHibernate as persistent layer, may be NHibernate is limited to 4000 characters.

Thanks|||NText is 1gig because Unicode is multibytes. Hope this helps.|||Hi,

Try to post this problem on this forum http://sqlservercentral.com/forums/Default.aspx.

Or post some code that you are executing, or T-SQL commands to createthe table with column that is truncating your string. It sounds likethis column is nvarchar(4000), not ntext. 8000 bytes, this is the limitfor nvarchar.|||My column data type is "ntext" and acually i tried t-sql command to insert the very long text and there is no problem.

I guess, my problem as i said earlier is the persisten layer "NHibernate". it should've give me exception if i exceed the allowed size but i don't get any. Therefore, what i am guessing is, the maximum allowed size for NHibernate is 4000 chars..most likly is trunckates strings before it saves.

I also know that it is possible to tell NHibernate about the data types of the columns. I will try that.

Thanks|||Sorry,

I wasn't to helpful last time :) but I googled it, and found this post:

http://www.castleproject.org/index.php/ActiveRecord:Troubleshooting#Text_Columns_are_truncated_in_Sql_Server

Hope this time it will help :)|||I really thanks you...
I was guessing but now you make me sure of the NHibernate bug.
Thanks again

No comments:

Post a Comment