I have Problem When I try To Send More Then 4000 char To SQL Server Database !!!
I have Create Windows Application that Send data To SQL Server Database in Web Server .. But When I try To Send More Then 4000 char to (nText) Flied The data damaged
And also in the Remote database I cant Create Filed of (nVarChar) data type with length more then 4000 char
In another word
I cant Store More then 4000 char in filed of (nText) data type
And I cant Create (nVarChar) filed with more then 4000 char Length
Where is the problem ??
And How can I solve it
Thanks with my regardingAn NVarchar field in SQL 7/2000 cannot be longer than 4000 (+- some) because the total size of any row in a SQL Server database cannot exceed 8196 (as I recall). nText fields do not count against that value, because they are stored on a seperate data page.
Please show the code (including any stored procedure) to try and insert the data.|||for your windows app problem, make sure you have an up to date mdac.
i had some odd problems years ago that were resolved by an mdac update.
for your 4000 character nvarchar problem,
varchar fields are actually limited to 8000 bytes (not characters)
(total row size of all populated varchars cannot exceed 8192)
for an nvarchar, the same 8000 byte limit applies.
since the n types are double byte, 4000 characters = 8000 bytes|||I think you have Datatype mixing problem you are sending ASCII to Unicode column, change the CHAR to NCHAR because in SQL Server 2000 you can Unicode enable per table and Column then run the code a again. I am assuming you know NTEXT is not Table Row based SQL Server creates an Arithmetic pointer to the data. Hope this helps.
Kind regards,
Gift Peddie|||Thanks for all replies
I have solve my problem
It is when I send the data to SQL Server I don't explicitly provide the data type of the filed in C# Code .. this is my problem.
The wrong code
SQLCommand.Parameters.Add("@.fld_Name", ValueObject);
the correct code
SqlParameter pr = new SqlParameter("@.fld_ Name", SqlDbType.NText);
pr.Value = ValueObject;
SQLCommand.Parameters.Add(pr);
It's simply like that
And I am very thanks for all reply
Fraas
No comments:
Post a Comment