This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DECLARE @Body VARCHAR(200), @Count VARCHAR(50), @endtime DATETIME; | |
| SET @endtime = GETDATE(); | |
| DECLARE @starttime DATETIME; | |
| SET @starttime = DATEADD(HH, -1, @endtime); | |
| IF OBJECT_ID('tempdb..#LogEntries') IS NOT NULL | |
| DROP TABLE #LogEntries; | |
| CREATE TABLE #LogEntries |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DECLARE @IntervalInHours TINYINT, @IsDBMailEnabled BIT, @MailSubject VARCHAR(100), @TableHTML VARCHAR(500) | |
| SET @IntervalInHours = 1 | |
| IF EXISTS( | |
| SELECT 1 | |
| FROM master.sys.databases db | |
| WHERE DATEDIFF(HOUR, db.create_date, GETDATE()) <= @intervalInHours | |
| AND db.name <> 'tempdb') | |
| BEGIN |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DECLARE @Body VARCHAR(200), @Count VARCHAR(50), @endtime DATETIME; | |
| SET @endtime = GETDATE(); | |
| DECLARE @starttime DATETIME; | |
| SET @starttime = DATEADD(hh, -1, @endtime); | |
| IF OBJECT_ID('tempdb..#LogEntries') IS NOT NULL | |
| DROP TABLE #LogEntries; | |
| CREATE TABLE #LogEntries |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DECLARE @Body VARCHAR(200), @Count VARCHAR(50), @endtime DATETIME; | |
| SET @endtime = GETDATE(); | |
| DECLARE @starttime DATETIME; | |
| SET @starttime = DATEADD(hh, -1, @endtime); | |
| IF OBJECT_ID('tempdb..#LogEntries') IS NOT NULL | |
| DROP TABLE #LogEntries; | |
| CREATE TABLE #LogEntries |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DECLARE @Body VARCHAR(200), @Count VARCHAR(50), @endtime DATETIME; | |
| SET @endtime = GETDATE(); | |
| DECLARE @starttime DATETIME; | |
| SET @starttime = DATEADD(hh, -1, @endtime); | |
| IF OBJECT_ID('tempdb..#LogEntries') IS NOT NULL | |
| DROP TABLE #LogEntries; | |
| CREATE TABLE #LogEntries |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| USE [Admin] | |
| GO | |
| CREATE PROCEDURE [dbo].[usp_cpuAlert_all_servers] | |
| AS | |
| SET NOCOUNT ON | |
| DECLARE @SQL NVARCHAR(2000); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| USE [Admin] | |
| GO | |
| ------------------------------------------------------------------------------------------------------------------------- | |
| /* | |
| Procedure Name : USP_PING_ALERT | |
| Descriptions : Procedure determines the current state of SQL Services | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| USE [Admin] | |
| GO | |
| CREATE procedure [dbo].[backup_report] | |
| as | |
| begin | |
| declare @serv nvarchar(35) | |
| declare @string varchar (500) | |
| truncate table bkp_report |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| USE [Admin] | |
| GO | |
| /* | |
| Name: USP_Fragmentation_Report | |
| Description: This SP uses linked servers to connect to all the servers whose names are present in table | |
| SmartReIndex_servers and pulls the latest reindex details and populates that data into table fragementation_Report | |
| PreRequisite: 1. Smart ReIndex has to be configured in a server in order for this SP to work 2.Server name | |
| should be added to the table SmartReIndex_servers and linked server should be created for that server | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| USE [master] | |
| /* | |
| Procedure Name : USP_Create_Snapshot | |
| Description : Creates snapshot for the database whose name is passed a parameter to this SP | |
| Execution Instruction : EXEC dbo.USP_Create_Snapshot @DBName | |
| Input Parameters : @DBName- database name | |
| */ | |
| CREATE Proc [dbo].[USP_Create_Snapshot](@DBName sysname) | |
| AS |
NewerOlder