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 where no matching records

Author  Topic 

leahsmart
Posting Yak Master

133 Posts

Posted - 2004-06-04 : 05:33:32
Hi Reader!

I want to delete all the records from tblScorecard where there is not a matching scorecard id in tblscore.

What is the best way to do this.

Something like the below would be great:

DELETE FROM tblScorecard WHERE ScorecardID NOT IN (SELECT ScorecardID FROM tblScore)

Any help is welcomed.

Leah

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2004-06-04 : 05:50:28
and what is wrong with your own solution?

Go with the flow & have fun! Else fight the flow :)
Go to Top of Page

leahsmart
Posting Yak Master

133 Posts

Posted - 2004-06-04 : 05:54:36
Well my solution does not appear to work.
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2004-06-04 : 06:02:22
maybe if you post your tables structure and sample data it would be easier to help...

Go with the flow & have fun! Else fight the flow :)
Go to Top of Page
   

- Advertisement -