Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

sp_truncate Expand / Collapse
Author
Message
Posted Friday, January 16, 2009 7:27 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Friday, July 19, 2013 7:07 AM
Points: 210, Visits: 160
Comments posted to this topic are about the item sp_truncate
Post #638051
Posted Friday, January 23, 2009 5:04 AM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, November 18, 2010 5:25 AM
Points: 162, Visits: 694
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
Post #642375
Posted Saturday, January 24, 2009 12:28 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, June 16, 2010 7:51 AM
Points: 6, Visits: 21
That is the kind of procedure all developer must have. Sure, there can be improvements, and you will make this code ever better.

Post #643029
Posted Saturday, January 24, 2009 12:43 PM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Friday, July 19, 2013 7:07 AM
Points: 210, Visits: 160
Thanks guys. Although it has a low rating here :D 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 :)
Post #643037
Posted Sunday, August 30, 2009 12:13 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Tuesday, August 13, 2013 9:52 PM
Points: 55, Visits: 157
Hi All

this is my script that also attempts to truncate a referenced table:
http://www.sqlservercentral.com/scripts/Foreign+Key/65452/

Enjoy
Post #779537
Posted Monday, August 31, 2009 2:08 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Friday, July 19, 2013 7:07 AM
Points: 210, Visits: 160
I didn't use embedded sp_fkeys procedure there.
I did everything using the pure joins. :)
Heck... I wrote it - one year ago. lol
Post #779736
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse