I'm trying to execute the below-mentioned query in MSSQL.
insert into STUDENT (STUDENT_NAME, STUDENT_MARKS, SID) values ('索引', 10, 2)
STUDENTNAME column is of type NVARCHAR.
After execution of the above query. The student name getting inserted is: ??
I understand that the above issue is related to encoding and so I modified the above query by adding N, as shown below :
insert into STUDENT (STUDENT_NAME, STUDENT_MARKS, SID) values (N'索引', 10, 2)
The above query is running as expected and is inserting the Chinese characters successfully.
Question: I'm using JDBC to execute this insert query, So do I need to proceed all the values with N as shown above. Or there is some other setting at the driver level to fix this?