0

This is my code:

enter image description here

As you can see varchar is not recognized as a Data-Type and it gives an error when executed.

Does anyone know why?

Siyual
  • 16,415
  • 8
  • 44
  • 58
Rajith
  • 1
  • 1
  • Please put your code in your message, not as static images that cannot be copied/pasted for testing. Also, "salary" should never be a float. – pmbAustin Aug 09 '17 at 18:24

2 Answers2

1

looks like you are using sql server CE, if so you need to use nvarchar

OLIVER.KOO
  • 5,654
  • 3
  • 30
  • 62
0

Your code is fine, but you are missing a "," in the second table. See below.

CREATE TABLE Employee170340 ( eno Integer, ename varchar(20), job varchar(20), dno Integer, salary float constraint Employee_170340 PRIMARY KEY (eno) )

CREATE TABLE Family170340 ( eno Integer, name varchar(15), relationship varchar(20), constraint Family_170340 primary key (eno, name) ,constraint Family_870 foreign key (eno) references Employee170340 (eno) )

BI_WORK
  • 1
  • 1