sp_truncate

  • Comments posted to this topic are about the item sp_truncate

  • Like the script. However, I noticed 2 areas for improvement. If I'm "deleting" all the rows from the primary key, I want all the foreign rows wiped out as well. Also, the foreign key constraints get dropped and recreated, but it is missing the cascade options.

    I have a similar procedure, but mine was written for a specific table. I guess I could modify it to handle more, but it would probably be easier to modify your procedure.

    Thanks, IMHO, that's a very valuable script.

    Honor Super Omnia-
    Jason Miller

  • That is the kind of procedure all developer must have. Sure, there can be improvements, and you will make this code ever better.

  • Thanks guys. Although it has a low rating here 😀 it really did save lots of time for me.

    We had a bunch of tables which needed this kind of intervention so I had to make it.

    thanks 🙂

  • Hi All

    this is my script that also attempts to truncate a referenced table:

    http://www.sqlservercentral.com/scripts/Foreign+Key/65452/[/url]

    Enjoy

  • I didn't use embedded sp_fkeys procedure there.

    I did everything using the pure joins. 🙂

    Heck... I wrote it - one year ago. lol

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply