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
 SQL Server 2000 Forums
 Transact-SQL (2000)
 delete with JOIN

Author  Topic 

mike123
Master Smack Fu Yak Hacker

1462 Posts

Posted - 2006-11-10 : 00:07:08

Hi,

I'm trying a query that seems pretty simple and I thought would work. Is it not possible to do a DELETE statement this way? If not, how can I do this ?



DELETE tblspamreports SR

INNER JOIN tblmessage MES ON MES.messageID = SR.offendingID

WHERE SR.spamTypeID=2 and MES.messageFrom = 1000


Much appreciated!

Thanks,
Mike123

robvolk
Most Valuable Yak

15732 Posts

Posted - 2006-11-10 : 00:30:19
Almost had it:

DELETE SR
FROM tblspamreports SR INNER JOIN tblmessage MES ON MES.messageID = SR.offendingID
WHERE SR.spamTypeID=2 and MES.messageFrom = 1000

Go to Top of Page

mike123
Master Smack Fu Yak Hacker

1462 Posts

Posted - 2006-11-10 : 01:06:49
thanks rob! :)
Go to Top of Page
   

- Advertisement -