I have created two columns in a tables with NATIONAL VARCHAR Data Type? But, when i am running the command, desc The result shows the datatype as varchar, not nvarchar. Why is it so? Am i doing some thing wrong?

PENAME NATIONAL VARCHAR(255),
PNAME NATIONAL VARCHAR(255) NOT NULL,
有帮助吗?

解决方案

MySQL does not have separation of nvarchar and varchar (like SQL Server).

Instead, you define the CHARACTER SET (aka CHARSET) to describe the data (ansi, utf8 etc) therein. This is orthoganal to collation in MySQL (collation defines how the data is sorted and compared)

NATIONAL VARCHAR (n) is just a synonym for VARCHAR (n) CHARACTER SET utf8

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top