haneen
haneen

Reputation: 3

Can I retrieve Arabic text that stored in varchar column in Arabic Collate that stored from another database in Latin Collate

I have two database one of them in Latin collate and have Arabic data. In some case I take data that stored in the first database and store it in the second database table which has Arabic collate but each column in both database have varchar datatype. When I store data in the second database, It stored text with question mark.

If I change the type to nvarchar every thing goes well but old data still has question mark how can I retrieve the old data

I try to get old data but I get unreadable text with question mark.

CREATE TABLE dbo.cust_supp (
    company_id t_id_char2   NOT NULL,
    acc_name_a t_id_var70       NULL,
    acc_name_e t_id_var70       NULL,
    closed_by  numeric(4,0)     NULL COLLATE SQL_Latin1_General_CP850_CI_AS
);

CREATE TABLE dbo.dcl_item_update (

    item_update_id   numeric(18,0) NOT NULL IDENTITY,
    item_group_id    numeric(18,0) NOT NULL,
    change_column_id numeric(9,0)  NOT NULL,
    dcl_record_key   numeric(9,0)  NOT NULL,
    old_value        varchar(510)      NULL COLLATE Arabic_CI_AS,
    new_value        varchar(510)      NULL COLLATE Arabic_CI_AS
);

I store the acc_name_a value in to the columns old_value and new_value.

Upvotes: 0

Views: 339

Answers (1)

Blag
Blag

Reputation: 5894

Did this work ? (I don't have an SQL Server right now to try, and I'm not sure if it's really what you want either...)

INSERT INTO dbo.dcl_item_update (old_value)
SELECT closed_by COLLATE Arabic_CI_AS as closed_by 
FROM dbo.cust_supp

Upvotes: 0

Related Questions