Tuesday, March 27, 2012

Delete ALL rows in All Tables in a Single Database

Is there any easy way to do this?(1) Script the objects, drop the database, re-create the database, run your
objects script.
(2) Drop all foreign key constraints, and then EXEC sp_msForEachTable
'TRUNCATE TABLE ?'
See yesterday's thread: "removing all data from all users table"
(It's often useful to scan the newsgroup quickly before posting your
question; you might avoid having to wait for an answer.)
http://www.aspfaq.com/
(Reverse address to reply.)
"Sarah" <skingswell@.donotreply.com> wrote in message
news:eYWQoNkSEHA.3872@.TK2MSFTNGP10.phx.gbl...
> Is there any easy way to do this?
>

No comments:

Post a Comment