Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin.
Search for scripts directly from SSMS, and instantly access any saved scripts in your
SSC briefcase from the favorites tab.
Download now (direct download link)
Thank this author by sharing:
By Jonathan Roberts,
I needed a procedure reset a Data Warehouse. To do this I needed to truncate all the Dimension, Fact and Bridge tables. This stored procedure allows the fast truncation of any table that has foreign keys referencing at columns on the table. It drops all the foreign keys referencing the table to be truncated, truncates the table, re-creates the foreign keys.
The call to the stored procedure is:
EXEC dbo.INFTruncateTable 'Orders', 'dbo'
To process an entire database a script can be set up that will process each of the tables:
test post for debugging
Debugging through procedure
Problem In Debugging