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.
vensaliAsked:
Who is Participating?
 
Pawan KumarDatabase ExpertCommented:
With SQL Server it is not possible. You may need to have to look at this -

https://www.codeproject.com/Questions/806331/IS-there-any-free-dll-which-helps-to-convert-from

You need Google's API to convert this. Try to create a CLR function and call Google's API in there and use CLR function in the SP.
0
 
Pawan KumarDatabase ExpertCommented:
Complete sample example for you. Note you have to convert the english character in kannada using google. SQL cannot convert English to SQL by itself.

Example - Go to google -> Say Pawan in HINDI and you will get it.

Table creation and date generation

CREATE TABLE doctor
(
	 rowid INT
	,docname  NVARCHAR(1000)
	,doctorname VARCHAR(1000) 
)
GO

INSERT INTO doctor VALUES ( 1 , '' , 'Pawan' ) 
GO

Open in new window

Before Update Data

SELECT * FROM doctor       

/*------------------------ 
SELECT * FROM doctor       
------------------------*/ 
rowid       docname          doctorname
----------- -------------- - ---------------
1                            Pawan
                           
(1 row(s) affected)       

Open in new window


Update Solution -

UPDATE doctor
SET docname = N'पवन'
WHERE rowid = 1

Open in new window


After update output

SELECT * FROM doctor  

/*------------------------   
                             
SELECT * FROM doctor         
------------------------*/   
rowid       docname          doctorname
----------- ---------------- -------------------
1           पवन              Pawan
                             
(1 row(s) affected)

Open in new window

0
 
PortletPaulfreelancerCommented:
Declare @nvar as nvarchar(max);
set @nvar = N'ವೈದ್ಯರು'

select @nvar

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?
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

 
Pawan KumarDatabase ExpertCommented:
@Author -

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))

Open in new window

0
 
Pawan KumarDatabase ExpertCommented:
If you have multiple tables then you can use below-

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

Open in new window


BEFORE UPDATE

/*------------------------
SELECT * FROM doctor 
------------------------*/
rowid       docname
----------- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1           Pawan

(1 row(s) affected)

Open in new window


Update Solution / Query

UPDATE a
SET a.docname = b.docname
FROM doctor a
INNER JOIN B1 b ON a.rowid = b.rowid

Open in new window


AFTER UPDATE

SELECT * FROM doctor    

/*------------------------

SELECT * FROM doctor       
------------------------*/
rowid       docname
----------- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1           पवन

(1 row(s) affected)

Open in new window

0
 
vensaliAuthor Commented:
This is fine . but i wanted something lika sp or function where i pass an english word and get an ouput in kannada.
0
 
Pawan KumarDatabase ExpertCommented:
Provided solution.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.