Skip to content

Commit

Permalink
add log pruning
Browse files Browse the repository at this point in the history
  • Loading branch information
ProfiseeAdmin committed Aug 24, 2023
1 parent 40ef72a commit 6e820c4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Azure-ARM/sqlmaintenance.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
--Create and execute sproc for DB index rebuild, statistics update and defragmentation
CREATE OR ALTER PROCEDURE [AzureSQLMaintenance]
(
@operation nvarchar(10) = null,
Expand Down Expand Up @@ -486,4 +487,8 @@ begin
if @LogToTable=1 insert into AzureSQLMaintenanceLog values(@OperationTime,null,null,sysdatetime(),sysdatetime(),'End of operation')
if @ScriptHasAnError=1 raiserror('Script has errors - please review the log.',16,1)
end
print 'Create or Alter Stored Procedure Done'
print 'Create or Alter Stored Procedure Done'

--Execute sproc to prune logs
EXEC [logging].[pPurgeLoggingMessages] 30

0 comments on commit 6e820c4

Please sign in to comment.