The Adventures of a SQL Server DBA
Tips on T-SQL, SQL Server DBA stuff, and more!
Tuesday, August 16, 2011
Delete All Tables but Keep the Database
I needed to delete all the tables from a database this afternoon but keep the database itself. I managed to dig up this little snippet by Googling and it worked like a charm:
EXEC sp_MSforeachtable 'DROP TABLE ?'
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment