vensali
asked on
how to convert english tesxt to kannada using sql script
I have table where one column is defined as nvarchar. I would like to update the value in this column with kannada text ,
Update doctor set a.docname = b.doctorname
from doctor a inner join
(
select rowid, doctorname from doctor
) b on a.rowid = b.rowid
doctorname is in english. i want to update docname in kannada translation of doctorname.
Update doctor set a.docname = b.doctorname
from doctor a inner join
(
select rowid, doctorname from doctor
) b on a.rowid = b.rowid
doctorname is in english. i want to update docname in kannada translation of doctorname.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
@Author -
The update command you are using is bit complex , You can easily modify your update to below -
The update command you are using is bit complex , You can easily modify your update to below -
Update doctor set docname = CAST(doctorname AS NVARCHAR(MAX))
If you have multiple tables then you can use below-
Data Generation and Table creation-
BEFORE UPDATE
Update Solution / Query
AFTER UPDATE
Data Generation and Table creation-
CREATE TABLE doctor
(
rowid INT
,docname NVARCHAR(1000)
)
GO
INSERT INTO doctor VALUES ( 1 , 'Pawan' )
GO
CREATE TABLE B1
(
rowid INT
,docname NVARCHAR(1000)
)
GO
INSERT INTO B1 VALUES ( 1 , N'पवन' )
GO
BEFORE UPDATE
/*------------------------
SELECT * FROM doctor
------------------------*/
rowid docname
----------- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 Pawan
(1 row(s) affected)
Update Solution / Query
UPDATE a
SET a.docname = b.docname
FROM doctor a
INNER JOIN B1 b ON a.rowid = b.rowid
AFTER UPDATE
SELECT * FROM doctor
/*------------------------
SELECT * FROM doctor
------------------------*/
rowid docname
----------- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 पवन
(1 row(s) affected)
ASKER
This is fine . but i wanted something lika sp or function where i pass an english word and get an ouput in kannada.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Provided solution.
Open in new window
There isn't a problem storing the wanted value, but I am perplexed by your update query.is there only one table?
or two tables?
or do you have 2 columns in the same table?