Incorrect syntax near 'FK_dbo.SalesOrderLineTasks_dbo.Events_Event_ID'

132 views Asked by At

When I try and run

alter table salesorderlinetasks drop constraint 
'FK_dbo.SalesOrderLineTasks_dbo.Events_Event_ID'

this command in Sql Server Management Studio, I get an error.

Incorrect syntax near 'FK_dbo.SalesOrderLineTasks_dbo.Events_Event_ID'.

What should I do?

2

There are 2 answers

0
Aparnaa On

It should contain double quotes instead of single quotes.

5
Bohemian On

Use no quotes:

alter table salesorderlinetasks drop constraint 
  FK_dbo.SalesOrderLineTasks_dbo.Events_Event_ID

Quotes delimit literal text, but alter requires an entity (which is not a text string but a plain entity name).