Home > Archive > MS SQL Server > November 2006 > I've given up... Alter table... Add Constraint...









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author I've given up... Alter table... Add Constraint...
Metal

2006-11-30, 7:14 pm

Hi,

what is wrong with my query:
ALTER TABLE contact ADD CONSTRAINT contact_FK_1 FOREIGN KEY (company_id)
REFERENCES company(id) ON DELETE SET NULL;

the following error ocures:
Msg 156, Level 15, State 1, Line 1
Incorrect syntax near the keyword 'SET'.

Thanks
Metal


Roy Harvey

2006-11-30, 7:14 pm

Are you using SQL Server 2005? ON DELETE SET NULL was not available
in 2000. Is the database in Compatibility Level 90? If it is
anything lower (older) it would not accept that syntax.

Roy Harvey
Beacon Falls, CT

On Sun, 26 Nov 2006 08:37:00 +0100, "Metal" <javajohn@o2.pl> wrote:

>Hi,
>
>what is wrong with my query:
>ALTER TABLE contact ADD CONSTRAINT contact_FK_1 FOREIGN KEY (company_id)
>REFERENCES company(id) ON DELETE SET NULL;
>
>the following error ocures:
>Msg 156, Level 15, State 1, Line 1
>Incorrect syntax near the keyword 'SET'.
>
>Thanks
>Metal

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com