Ratha
Ratha

Reputation: 9692

mysql workbench converts the nvarchar columns to varchar?

I have defined my tables as follows;

CREATE TABLE IF NOT EXISTS test.notes ( id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, clientid INT(10) NOT NULL,
userid INT(10) NOT NULL,
notes NVARCHAR(256) NULL DEFAULT NULL, createddatetime TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (id)) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8;

here the notes column i defined as navarchar, but finally it turns as varchar column. Im using 6.3 version . What is wrong here?

Upvotes: 2

Views: 968

Answers (1)

Tim Biegeleisen
Tim Biegeleisen

Reputation: 521194

From the MySQL documentation, we can see that internally MySQL will just map NVARCHAR to VARCHAR with a UTF-8 character set. The documentation mentions that the following definitions are all equivalent:

VARCHAR(10) CHARACTER SET utf8
NATIONAL VARCHAR(10)
NVARCHAR(10)
NCHAR VARCHAR(10)
NATIONAL CHARACTER VARYING(10)
NATIONAL CHAR VARYING(10)

Upvotes: 4

Related Questions