Kumpulan Query SQL Hapus Data Server Pulsa Otomax

  1. Umum
  2. 4 tahun yang lalu
  3. 3 min read

Kumpulan query otomax ini berfungsi banyak sekali untuk menjaga database anda agar tidak penuh atau tidak kebesaran file database nya, jika database mdf dan ldf anda tepatnya : OtomaX.mdf dan OtomaX.LDF anda mencapai bergiga-giga dengan kondisi yang tidak wajar maka anda harus menghapus beberapa data, nah berikut ini adalah kumpulan query hapus data sql server pulsa dengan software otomax.

Kumpulan Query SQL Hapus Data Server Pulsa Otomax

SQL Query Delete berkas Modul yang sudah TERHAPUS :

DELETE from modul where deleted=’1′

SQL Query Delete Data Mutasi Poin :

DELETE from penukaran_poin WHERE tgl_tukar < ‘2019-01-13 00:00’

SQL Query Delete Data Tiket Bank :

DELETE from dbo.data_bank WHERE tgl_proses < ‘2018-12-13 00:00’

SQL Query Delete FISIK / Voucher :

DELETE from dbo.fisik where status = ‘2’

SQL Query Delete Format Salah,Komplain :

use otomax
DELETE FROM inbox WHERE status=23;
DELETE FROM inbox WHERE status=42;
DELETE FROM inbox WHERE status=41;
DELETE FROM inbox WHERE status=21

SQL Query Delete from log :

DELETE FROM sistem_log where tipe = ‘2’

SQL Query Delete INBOX Reply :

DELETE Inbox WHERE status = ’40’

SQL Query Delete INBOX sebelum tanggal :

DELETE Inbox WHERE tgl_entri < ‘2018-10-13 00:00’

SQL Query Delete KOMISI yg sdh di tukar :

DELETE FROM komisi where tukar=’1′

SQL Query Delete MUTASI sebelum tanggal :

DELETE from mutasi WHERE tanggal < ‘2017-06-30 00:00’

SQL Query Delete OUTBOX kirim pesan ke sms END user :

DELETE from outbox where Convert(char, tgl_entri,101) < Convert(char, getdate(),101) AND penerima not in (select pengirim from pengirim) AND kode_reseller IN (select kode from reseller)

SQL Query Delete OUTBOX sebelum tanggal :

DELETE Outbox WHERE tgl_entri < ‘2018-03-22 00:00’

SQL Query Delete Pesan BROADCAST :

DELETE FROM outbox WHERE prioritas=’5′ AND Convert(char, tgl_entri,101) < Convert(char, getdate(),101)

SQL Query Delete TRANSAKSI sebelum tanggal :

DELETE Transaksi WHERE tgl_entri < ‘2018-06-22 00:00’

SQL Query reindex OtomaX :

USE otomax

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

CLOSE TableCursor

DEALLOCATE TableCursor

SQL Query reindex OtomaX–ke 2 setelah reindex :

EXEC sp_MSforeachtable @command1=”ALTER INDEX ALL ON ? REBUILD”
DBCC SHRINKDATABASE (0, 10)

TIKET DEPOSIT :

DELETE from dbo.tiket_deposit WHERE tgl_status < ‘2018-12-13 23:59’

Cara menerapkan querynya sudah pasti bisa kan? kalau belum begini caranya :

Buka SQL Server Management dan masuk, lalu buka menu Query dan salin lalu tempel (copy paste) kode-kode diatas ke laman query tersebut. begini gambar nya :

Setelah di salin untuk proses hapus data anda harus klik Execute. setelah klik execute tunggu hingga proses selelsai seperti gambar diatas.

Nah kode-kode diatas itu tanggalnya adalah tanggal lama silahkan disesuaikan sampai tanggal berapa data transaksi akan dihapus anda tinggal merubahnya saja.

Terimakasih semoga bermanfaat.

umum
Share: