Saturday 1 December 2012

drop all table from sql server database

drop table from sql server database

EXEC sp_MSforeachtable @command1 = "DROP TABLE ?"

other commands can u use for Alter And delete 

EXEC sp_MSForEachTable 'ALTER TABLE ? NOCHECK CONSTRAINT ALL'
EXEC sp_MSForEachTable 'DELETE FROM ?'
EXEC sp_MSForEachTable 'ALTER TABLE ? CHECK CONSTRAINT ALL'

No comments:

Post a Comment