Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by carnahantom

  1. carnahantom

    Find and Delete All Orphan Child records in database?

    I was looking for ways to speed up the script that GK53 suggested. I had someone here suggest that I use the following code to speed up my overall process: exec sp_msforeachtable @command1="alter table ? nocheck constraint all"; exec sp_msforeachtable @command1="alter table ? disable trigger...
  2. carnahantom

    Find and Delete All Orphan Child records in database?

    GK53, For other tables that I needed to shrink, I: [ol 1] copied the records to retain to a temporary table (SELECT * INTO tempTable FROM ...) truncated the original table inserted the retained records from the temp table into the original dropped the temp table [/ol] That worked...
  3. carnahantom

    Find and Delete All Orphan Child records in database?

    Hi George, The table I am trying to shrink has a trigger, many FKs pointing to it, and worse, a bunch of schema-bound views that prevent me from dropping it. I am going to try Option #2 to see how it does. Thanks George and GK53! Tom
  4. carnahantom

    Find and Delete All Orphan Child records in database?

    GK53 -- I am not quite sure what you are suggesting. I am trying to stay away from transactions, but what you are suggesting is interesting, yet I don't see how it would speed things up and keep the log size small. The tables I have to shrink are large, have triggers and lots of FKs that...
  5. carnahantom

    Find and Delete All Orphan Child records in database?

    I am working in a transactional SQL Server 2012 development environment where I am writing a script to "shrink" (remove excess records from) the large tables in backup copies of our Production database. The tables have record counts in the multi-million range. Referential is not a big issue for...

Part and Inventory Search

Back
Top