Q:

How to store non english unicode characters using dynamic query in SQL Server

I want to save non-english unicode characters into a table in SQL Server. 
declare @cSql varchar(200)
set @cSql = ''

declare @cCode varchar(10)
set @cCode = '001'

declare @cKName Nvarchar(200)
set @cKName = N'ಒಂದು'

Insert into DepMast (omCode, omKName)
Values(@cCode, @cKName)

On executing the above code, the unicode characters are saved as required. 
But, if I use dynamic query, '?????'  is stored. 
set @cSql = 'Insert into DepMast (omCode, omKName)
             Values(''' + @cCode + ''',''' + @cKName + ''')'

exec(@cSql)

Any ideas on storing unicode characters using dynamic query? 

A:

Two reasons for this behaviour - firstly, you have declared @cSql as varchar datatype and @cKName as nvarchar datatype.  Secondly, you are not prefixing the value with N when inserting.  This should fix the issue
declare @cSql nvarchar(200) --changed datatype to nvarchar
set @cSql=''
declare @cCode varchar(10)
set @cCode='001'
declare @cKName nvarchar(200)
set @cKName=N'ಒಂದು' 
set @cSql='Insert into DepMast (omCode,omKName)
Values('''+@cCode+''',N'''+@cKName+''')' -- added the "N" prefix
exec(@cSql)

