Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ERROR - The specified data type is not valid. [ Data type (if known) = varchar ] [duplicate]

I have recently installed SQL 2008 R2

CREATE TABLE TPERSONS(
personid int PRIMARY KEY NOT NULL,
lastname varchar(50) NULL,
firstname varchar(50) NULL,
salary money NULL,
managerid int NULL -- foreign key to personid
)

I do not understand why I receive this error.

Major Error 0x80040E14, Minor Error 26302

)
The specified data type is not valid. [ Data type (if known) = varchar ]
like image 248
Alison Furnish Avatar asked Jun 11 '13 21:06

Alison Furnish


People also ask

Is VARCHAR valid data type?

The VARCHAR data type accepts character strings, including Unicode, of a variable length is up to the maximum length specified in the data type declaration. A VARCHAR declaration must include a positive integer in parentheses to define the maximum allowable character string length.

What is the maximum VARCHAR size in SQL Server?

Values in VARCHAR columns are variable-length strings. The length can be specified as a value from 0 to 65,535. The effective maximum length of a VARCHAR is subject to the maximum row size (65,535 bytes, which is shared among all columns) and the character set used.

What information does @@ error hold in SQL?

Returns the error number for the last Transact-SQL statement executed.


1 Answers

The data type varchar is not one of the supported data types on SQL Server CE. You must use nvarchar.

Note that date is not supported, either. Use datetime instead.

like image 113
ErikE Avatar answered Oct 01 '22 03:10

ErikE