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
 General SQL Server Forums
 New to SQL Server Programming
 DELETE for newbie

Author  Topic 

salisan
Starting Member

2 Posts

Posted - 2008-06-30 : 21:46:06
hi, I have this SELECT statement that works correctly and results in 4 records:

SELECT *
FROM ProdOpt_Choices INNER JOIN
dbo.vwProdOptionToDelete ON ProdOpt_Choices.Option_ID = dbo.vwProdOptionToDelete.Option_ID AND
ProdOpt_Choices.Option_ID = dbo.vwProdOptionToDelete.Option_ID

Now I want to DELETE those 4 records but the following keeps throwing errors (using MS SQL Server 2000):

DELETE
FROM ProdOpt_Choices INNER JOIN dbo.vwProdOptionToDelete ON ProdOpt_Choices.Option_ID = dbo.vwProdOptionToDelete.Option_ID AND
ProdOpt_Choices.Option_ID = dbo.vwProdOptionToDelete.Option_ID

Thanks for any ideas

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-06-30 : 22:11:39
Delete PC
from ProdOpt_Choices PC inner join dbo.vwProdOptionToDelete PD
on PC.Option_ID = PD.Option_ID
Go to Top of Page

salisan
Starting Member

2 Posts

Posted - 2008-06-30 : 22:17:42
Thanks very much, that works perfect.
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-06-30 : 22:41:54
Welcome
Go to Top of Page
   

- Advertisement -