SQL Server defines an extension to the DELETE syntax which allows you to specify a JOIN which defines the rows to be deleted:
Code:
DELETE Location
FROM Location INNER JOIN Project
ON Location.LocationID = Project.LocationID
WHERE Project.ProjectID=2;
will work, but this is non-standard, and so it probably isn't available on any other RDBMS. Owain's method of using a sub-query is best (and fastest), IMO.
Jeff Mason
Custom Apps, Inc.
www.custom-apps.com