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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
PortletPaulEE Topic AdvisorCommented:
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
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
Amazon Web Services

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Pawan KumarDatabase ExpertCommented:
Provided solution.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
SQL

From novice to tech pro — start learning today.