Question

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,
Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top