
Truncate all the Tables in a Database with PowerShell
TLDR; This code will script out foreign keys and views (including object level permissions), drop the objects, truncate all the tables, and recreate the objects. The Details The most popular post on my blog so far was called ‘Disable all Triggers on a Database’ and this one is a good follow up from that post.…