sp_truncate

  • sergey.benner

    Ten Centuries

    Points: 1048

    Comments posted to this topic are about the item sp_truncate

  • Jason Miller-476791

    SSCommitted

    Points: 1510

    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

  • Martin Goebbels

    SSC Enthusiast

    Points: 190

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

  • sergey.benner

    Ten Centuries

    Points: 1048

    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 🙂

  • kodracon

    Ten Centuries

    Points: 1027

    Hi All

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

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

    Enjoy

  • sergey.benner

    Ten Centuries

    Points: 1048

    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 6 (of 6 total)

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