January 16, 2009 at 7:27 am
Comments posted to this topic are about the item sp_truncate
January 23, 2009 at 5:04 am
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
January 24, 2009 at 12:28 pm
That is the kind of procedure all developer must have. Sure, there can be improvements, and you will make this code ever better.
January 24, 2009 at 12:43 pm
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
August 30, 2009 at 12:13 am
Hi All
this is my script that also attempts to truncate a referenced table:
http://www.sqlservercentral.com/scripts/Foreign+Key/65452/%5B/url%5D
Enjoy
August 31, 2009 at 2:08 am
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
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy