To delete all the tables from a database:
Select 'drop table ' + Object_name(object_id) from sys.objects where type = 'U'
(or)
EXEC sp_MSforeachtable @command1 = "DROP TABLE ?"
To Delete All Records from a table:
Select 'delete from ' + Object_name(object_id) from sys.objects where type = 'U'
Tuesday, January 20, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment