Welcome to weblogs.com.pk Sign in | Join | Help

Aziz ur Rahman

Random Thoughts


  • The WeatherPixie
    Listed on BlogShares

    Counter : simple hit counter
SQLServer : Problem in inserting Arabic data using ntext datatype
Have you ever tried to insert arabic data using ntext data type in SQL Server2000? I am sure you had. Did you face any strange problems? I had. It was a dotnet based desktop application. The strange problem was: If I insert english data, it comes back fine but if I insert arabic data, it gets corrupted. Strange, we were doing this in our web based news portal site and it is working fine there.

Then I dig into the problem. I came to know that if the data is smaller in size, it goes back and forth properly. But if it is a little bit bigger it gets corrupted. That was just heuristically tested. I figured that data bigger than 4000 char is making the problem. I checked the documentation but there is nothing there.

I consulted the guys responsible for news portal website. I asked them whether they are doing something special. Why they are not having this problem. Finally they reported that they encrypt the article contents before putting it in the database for security reasons and decrypting before displaying on the website.

They forwarded me the Encrypt/Decrypt class. I used the same technique and WALLAAAAA.... it worked. Now I can insert records bigger than 6000 and it is coming back just fine.

Cannot figure out the problem, unable to figure the solution as well. Just used CP technology (Copy Paste Technology) to solve the problem. I will dig into it more when I get some time. If you ever encountered such problem, please comment.

Posted: Wednesday, March 08, 2006 9:03 AM by aziz
Filed under:


khurram said:

Have you tried using different collations?

# March 9, 2006 1:46 PM
Anonymous comments are disabled