user1552545
user1552545

Reputation: 1331

SQL Server changes characters in insert

My SQL Server changes same characters in the Strings.

Example:

insert into TEST_TABLE
values ('árvíztűrő tükörfúrógép2');

inserts

árvízturo tükörfúrógép

The TEST_TABLE has only one column with type varchar(50).

How can I insert strings into a table in SQL Server?

Upvotes: 1

Views: 295

Answers (3)

MK_
MK_

Reputation: 1169

Run the following code on your table:

ALTER TABLE TEST_TABLE ALTER COLUMN *ColumnName* nvarchar(50)

After that, it works like a charm (even without prefixing the inserting string with N).

Upvotes: 1

rrrr-o
rrrr-o

Reputation: 2516

You will most likely need an nvarchar (rather than varchar) data type on the column that allows unicode characters.

You will probably need to specify it being unicode too by prefixing the value with an "N".

insert into TEST_TABLE
values (N'árvíztűrő tükörfúrógép2');

Upvotes: 4

DineshDB
DineshDB

Reputation: 6193

Change the column datatype to nvarchar and try this:

insert into TEST_TABLE
values (N'árvíztűrő tükörfúrógép2');

Upvotes: 1

Related Questions