Forum Moderators: coopster

Message Too Old, No Replies

insert non-english data into MSSQL . how?

         

web_server

1:25 pm on May 19, 2006 (gmt 0)



Hi,
I have a problem with inserting non-english data into MSSQL. I'm using arabic data . I changed my data base collation to the right codepage . I also tried to use nchar and nvarchar instade of char but nothing works . I got rubbish in the database .
any ideas?
note : arabic works greate on mysql but I have to use mssql.
thank you .

omoutop

1:51 pm on May 19, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



well you see rubbish on the db, but how they appear on your page?

I have similar problems with the greek characters.
In db they are rubbish, but they appear correct on the page, so i gave no extra thought

web_server

2:01 pm on May 19, 2006 (gmt 0)



same problem..

ergophobe

4:38 pm on May 19, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



RE issue that characters as rubbish "in the db" and correct "on the page"

I put those in quotes because you have to remember that you are never looking straight into the DB. You are always accessing the DB with some sort of client, whether it's a web browser, a command line client, or some GUI client that connects to the DB. There are always at least three components at work here
- DB server
- underlying data
- client used to view data

Since it looks fine in one client and not another, you know that the data is fine and the server is functioning correctly, but one of your two clients is unable to display these characters.

An analgous situation occurs with images stored as BLOB fields. More often than not, whatever client you use to browse your DB and send queries will return a bunch of text gibberish when you select an image blob field. This isn't a problem, it just means that the client is incapable of rendering jpegs. Take that same data and send it to a browser with the proper MIME type header and you'll see an image. That said, send it to the browser with the wrong MIME type header and you'll just get gibberish. Same with a PDF stored as a BLOB.

So what you are seeing are not differences between the data in the DB and the data sent to the page - it's the same data. Rather, what this gibberish tells you is that one client (your servers/scipts/browser combo) can render that character set while another client (the default DB client packaged with your DB server) is not (either inherently or because of settings) able to handle arabic character sets.

So the first thing to ask is whether or not your client that you use to browse the DB can be set up to properly interpret and display the character set. If not, is there another client for your DB server that will?

web_server

2:23 pm on May 20, 2006 (gmt 0)



God Blessed..

I found the solution. it was by using ODBC.
try using it omoutop it may help you.