Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Getting errors?

Author  Topic 

deathrow
Starting Member

6 Posts

Posted - 2010-04-26 : 06:29:28
Hello, I am getting missing right parathesis on line 8 in booking

create table booking(
booking_id int not null,
booking_date date not null,
booking_time varchar(5) not null,
employee_id int not null,
location_lid varchar(2) not null,
constraint booking_booking_id_pk primary key (booking_id)
(line 8)constraint booking_employee_id_fk foreign key (employee_id) references employees(employee_id));

And the same thing on trainee on line 7

create table trainee(
trainee_id int not null,
trainee_name varchar(30) not null,
trainee_registration date not null,
trainer_id int not null,
constraint trainee_trainee_id_pk primary key (trainee_id)
(line 7)constraint trainee_trainer_id_fk foreign key (‘trainer_id’) references trainer(trainer_id);

And this last 1 i am getting identifier is too long on line 6

create table registration(
registration_id int not null,
registration_date date not null,
registration_time varchar(5) not null,
location_lid varchar(2) not null,
(line 6)constraint registration_registration_id_pk primary key (registration_id));

Can anyone help me out?

Thanks

Transact Charlie
Master Smack Fu Yak Hacker

3451 Posts

Posted - 2010-04-26 : 07:56:04
The first two are missing a comma,

Try

create table booking(
booking_id int not null,
booking_date date not null,
booking_time varchar(5) not null,
employee_id int not null,
location_lid varchar(2) not null,

constraint booking_booking_id_pk primary key (booking_id)

, constraint booking_employee_id_fk foreign key (employee_id) references employees(employee_id)
);

etc.

Your thirs one works fine for me

create table registration(
registration_id int not null,
registration_date date not null,
registration_time varchar(5) not null,
location_lid varchar(2) not null,
constraint registration_registration_id_pk primary key (registration_id));

What version of SQL Server are you on. Is working ok on 2008


Charlie
===============================================================
Msg 3903, Level 16, State 1, Line 1736
The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION
Go to Top of Page
   

- Advertisement -