Saturday, July 18, 2009

How to drop All tables from Database.

we can drop all table in one database using single line Query.There is an undocumented procedure which is very useful in seach Operation which seems complecated at first site.

Here is how to use this Procedure to drop all tables.

EXEC sp_MSforeachtable @command1="drop table ?"

we can change statements inside @command1 to perform different operation on all tables.


No comments:

Post a Comment

Comments posted on ASP.Net Ajax Tutorials Blog are moderated and will be approved only if they are on-topic and not abusive. Please email me or my team for tech-support or blogging related questions. Avoid including website URLs in your comments - Thanks Author