Custom CommandExecute Script
https://ola.hallengren.com
Custom Index Optimizer Script
Source: https://ola.hallengren.com User Database IndexOptimize Script
Custom Database Integrity Check Script
Source: https://ola.hallengren.com Database Integrity Check: System Database Database Integrity Check: User Database DatabaseIntegrityCheck Script
Custom Backup Database with Script
Source: https://ola.hallengren.com Backup: SYSTEM FULL Backup: USER FULL Backup: USER DIFF Backup: USER LOG [dbo].[DatabaseBackup] Script
Add Table Logging to Stored Procedure
Create table to store log data. Create stored procedure to insert data into log table. Add logging to user stored procedure. dbo.tbMyLog.sql dbo.uspInsertMyLog.sql Logging in uspMySP01 Remove log entries older than 1 month
Delete Log Records Older Than 1 Month
Delete records from log table where the records are older than 1 month.
WAITFOR
Sources: https://docs.microsoft.com/en-us/sql/t-sql/language-elements/waitfor-transact-sql?view=sql-server-ver15