This document contains SQL commands to clean up and optimize a database named "otomax". It deletes old records from several tables, resets the status of a stored procedure, sets the database to emergency mode for checks and repairs, then reindexes all tables to improve performance.
This document contains SQL commands to clean up and optimize a database named "otomax". It deletes old records from several tables, resets the status of a stored procedure, sets the database to emergency mode for checks and repairs, then reindexes all tables to improve performance.
This document contains SQL commands to clean up and optimize a database named "otomax". It deletes old records from several tables, resets the status of a stored procedure, sets the database to emergency mode for checks and repairs, then reindexes all tables to improve performance.
DELETE Outbox WHERE tgl_entri < '2013-03-01 00:00'
DELETE Transaksi WHERE tgl_entri < '2013-03-01 00:00'
DELETE from mutasi WHERE tanggal < '2013-05-01 00:00'
DELETE komisi where tukar='1'
EXEC sp_resetstatus �otomax�;
ALTER DATABASE otomax SET EMERGENCY DBCC checkdb(�otomax�) ALTER DATABASE otomax SET SINGLE_USER WITH ROLLBACK IMMEDIATE DBCC CheckDB (�otomax�, REPAIR_ALLOW_DATA_LOSS) ALTER DATABASE otomax SET MULTI_USER
DECLARE @TableName varchar(255)
DECLARE TableCursor CURSOR FOR
SELECT table_name FROM information_schema.tables WHERE table_type = 'base table'
OPEN TableCursor
FETCH NEXT FROM TableCursor INTO @TableName
WHILE @@FETCH_STATUS = 0 BEGIN DBCC DBREINDEX(@TableName,' ',95) FETCH NEXT FROM TableCursor INTO @TableName END
Microsoft Access Guide to Success: From Fundamentals to Mastery in Crafting Databases, Optimizing Tasks, & Making Unparalleled Impressions [III EDITION]