Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

error creating table with type text 1

Status
Not open for further replies.

mrdance

Programmer
Apr 17, 2001
308
SE
I am trying to create a field in MySQL with type text but I get this error;

1064 - You have an error in your SQL syntax near '(2000)' DEFAULT '0') at line 1.

I am using MySQL front and the SQL is like this;

CREATE TABLE news(content TEXT (2000) DEFAULT '0')

Thanks for any help!
 
TEXT column types are not the same as VARCHAR. They have a fixed maximum length, just like a BLOB (actually, text is just a case-insensitive BLOB). This means you cannot set the length such as TEXT (2000).

TEXT has a default maximum of 65535 characters, and you cannot change this. Also, TEXT and BLOB column types cannot have a default value. CREATE TABLE news(content TEXT); is all you can do with this one.

See and
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top