If you need to perform the same actions for all tables in a database, you can create cursor or you can use the sp_MSforeachtable undocumented stored procedure to accomplish the same goal with less work.
Drop all tables from database
Drop all tables from database
Query is:
EXEC sp_MSforeachtable @command1 = "DROP TABLE ?"
No comments:
Post a Comment