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 |
|
raekdoe
Starting Member
3 Posts |
Posted - 2002-10-12 : 22:09:49
|
| Hello All,I am looking for a script or utility to run against my databse to check for orphan records. Then when it finds them to clean the tables up. Anyone know of such a thing?TIA,KevinYour as fast as your slowest link. |
|
|
ValterBorges
Master Smack Fu Yak Hacker
1429 Posts |
Posted - 2002-10-13 : 14:43:10
|
| Check out this article to find items that don't exist in other locations.http://www.sqlteam.com/item.asp?ItemID=448You can write a stored procedure that does this for all the orphans your checking. You'll have to modify to be like:DELETE FROM(SELECT STATEMENT) |
 |
|
|
|
|
|