You could generate a list of all the tables in the database by (first connecting to the database you want then) executing:
Or you could use the hidden Microsoft stored procedure, sp_MSforeachtable.SELECT * FROM sys.Tables Order by name ASC
EXEC sp_MSforeachtable @command1 = "PRINT '?'"Or more destructively:
--print the tables names with owner(dbo)
EXEC sp_MSforeachtable @command1 = "SELECT * FROM ?"
-- Selects all the rows form all the table
EXEC sp_MSforeachtable @command1 = "DROP TABLE ?"This was gleaned from this blog post.
EXEC sp_MSforeachtable @command1 = "DELETE FROM ?"EXEC sp_MSforeachtable @command1 = "TRUNCATE TABLE ?"
No comments:
Post a Comment