Useful Sql Queries

Truncate All Tables
EXEC sp_MSForEachTable 'TRUNCATE TABLE ?'

Truncate DB And Log Files
DBCC SHRINKDATABASE (UserDB, 10);
 
Truncate Log Files
DBCC SHRINKFILE (DB_Log, 1);

clear cache
DBCC FREEPROCCACHE   
DBCC DROPCLEANBUFFERS
 
Advertisements