Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete using inner join

Status
Not open for further replies.

j252ewv

Programmer
Jul 2, 2008
43
GB
Con some clever sole point out the error in the following delete script please:

delete from subscriptionmembers
inner join contacts on Contacts.contactid = subscriptionmembers.contactid
where
contacts.categorycode in ('CPAT','NMP','PAT','DEN','PRAC','DOC','TEA')

I get the error

Msg 156, Level 15, State 1, Line 2
Incorrect syntax near the keyword 'inner'.
 
You should double FROM clause:

Code:
delete from subscriptionmembers
from subscriptionmembers
inner join contacts on Contacts.contactid = subscriptionmembers.contactid
where contacts.categorycode in ('CPAT','NMP','PAT','DEN','PRAC','DOC','TEA')

Borislav Borissov
VFP9 SP2, SQL Server 2000/2005.
 
Your right! I knew it was something simple!!

Many thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top