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.
| Author |
Topic |
|
mike123
Master Smack Fu Yak Hacker
1462 Posts |
Posted - 2002-02-28 : 23:26:17
|
| I am tuning a poorly designed database that was put into production with no constraints. I have tables that need constraints however when I put them on they error out becuase there is invalid data.I am wondering how to write a query that will accomplish the following.All the messageFromID's that are in TBLMESSAGE and are not in TBLUSERDETAILS I would like to delete.Cheers Guys thx againTBLMESSAGE TBLUSERDETAILSMessageFromID UserID |
|
|
Merkin
Funky Drop Bear Fearing SQL Dude!
4970 Posts |
Posted - 2002-03-01 : 00:18:36
|
How aboutDelete From TBLMessageWHEREUserID NOT IN (Select UserID FROM TBLUserDetails) Damian |
 |
|
|
mike123
Master Smack Fu Yak Hacker
1462 Posts |
Posted - 2002-03-01 : 00:47:52
|
| thx |
 |
|
|
|
|
|