1

I am unable to insert Hindi text with passing parameter Please guid me through sql query and passing parametr only .

It is working --

insert into  MyTable (HindiText) values (N'जिए जाने किस रस्म जारी है')

but it is not working (Why)

declare @HindiText nvarchar(max)='जिए जाने किस रस्म जारी है';
insert into  MyTable (HindiText) values (N@HindiText)

declare @HindiText nvarchar(max)='जिए जाने किस रस्म जारी है';
insert into  MyTable (HindiText) values (N@HindiText)
Qirel
  • 25,449
  • 7
  • 45
  • 62
  • Hi please share your database definition like collation and other information . – Sanpas May 16 '19 at 06:51
  • Possible duplicate of [How to insert Hindi language in Mysql](https://stackoverflow.com/questions/11292898/how-to-insert-hindi-language-in-mysql) – Sanpas May 16 '19 at 06:52
  • Hi think this link can help you : https://stackoverflow.com/questions/11292898/how-to-insert-hindi-language-in-mysql – Sanpas May 16 '19 at 06:52
  • 1
    `declare @HindiText nvarchar(max) = N'जिए जाने किस रस्म जारी है';` and then just `VALUES (@HindiText)` - the `N` goes before the string, not the variable. – Qirel May 16 '19 at 06:54
  • @pascalsanchez Don't change the tags like that - it's a question about SQL server, not MySQL. – Qirel May 16 '19 at 06:55
  • @Qirel and the title i speak about mysql database ...... no SQL Server – Sanpas May 16 '19 at 06:56
  • But the syntax is SQL server. There is no `NVARCHAR` syntax in MySQL, it's SQL server. Appears the OP is confused about the title and his own tags and his code.. We need more details. – Qirel May 16 '19 at 06:59
  • Here's a thought - JUST STOP EDITING POSTS into your own idea of perfection. – SMor May 16 '19 at 12:53

1 Answers1

0

I have made a demo for you Please try this.

declare @HindiText nvarchar(max)=N'जिए जाने किस रस्म जारी है';
insert into  MyTable (HindiText) values (@HindiText)

NOTE: Make sure the data type of table column is NVARCHAR. And before write Hindi text their sud be N is there.

Nikunj Satasiya
  • 831
  • 9
  • 25