This file contains 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 | |
GO | |
-- Create table to hold valid IP values | |
CREATE TABLE ValidIPAddress (IP NVARCHAR(15) | |
CONSTRAINT PK_ValidAddress PRIMARY KEY) | |
-- Declare local machine as valid one | |
INSERT INTO ValidIPAddress | |
SELECT '<local machine>' |
This file contains 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
/* | |
Script to send an alert through mail, with information that how many drive | |
space is required from next databases growth on a specific instance and how many | |
space is available. | |
Script By: Amna Asif for ConnectSQL.blogspot.com | |
*/ |
This file contains 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 AdventureWorks | |
GO | |
--============== Supporting function dbo.udfGetFullQualName | |
IF OBJECT_ID('dbo.udfGetFullQualName') IS NOT NULL | |
DROP FUNCTION dbo.udfGetFullQualName | |
GO | |
CREATE FUNCTION dbo.udfGetFullQualName ( @ObjectId INTEGER ) |
This file contains 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
-- Table variable to hold intermediate data | |
DECLARE @ReportSQLErrorLogs TABLE | |
( | |
[log_date] [datetime] NULL, | |
[processinfo] [varchar](255) NULL, | |
[processtext] [text] NULL | |
) | |
DECLARE @NumErrorLogs INT, | |
@CurrentLogNum INT |
This file contains 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
/* | |
Script By: Aasim Abdullah/Amna Asif for ConnectSQL | |
Purpose: To create DDL Change Log using Service Broker, | |
for multiple databases on a single instance | |
*/ | |
IF NOT EXISTS (SELECT 1 FROM sys.databases WHERE name = 'ConnectDBA') | |
CREATE DATABASE ConnectDBA | |
GO | |
USE [ConnectDBA] | |
GO |
This file contains 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
/****************************************** | |
Script By: Aasim Abdullah | |
For : http://connectsql.blogspot.com | |
Purpose: To detect long running sessions, | |
send complete information through mail about such sessions | |
and killing session, which are acceding given limit of execution time. | |
******************************************/ | |
---BusyProcess Detection | |
SET NOCOUNT ON |
This file contains 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
--DROP IF ALREADY CREATED | |
IF EXISTS ( SELECT 1 | |
FROM SYS.procedures | |
WHERE NAME = 'SYNC_CreatePrimaryKeys' ) | |
DROP PROC SYNC_CreatePrimaryKeys | |
GO | |
--CREATE PROCEDURE | |
SET ANSI_NULLS ON | |
GO |
This file contains 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
--DROP IF ALREADY EXISTS | |
IF EXISTS ( SELECT 1 | |
FROM SYS.PROCEDURES | |
WHERE NAME = 'SYNC_Indexes' ) | |
DROP PROCEDURE SYNC_Indexes | |
GO | |
--CREATE PROCEDURE | |
SET ANSI_NULLS ON | |
GO | |
SET QUOTED_IDENTIFIER ON |
This file contains 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
--DROP IF ALREADY CREATED | |
IF EXISTS (SELECT 1 FROM sys.objects WHERE type = 'P' AND name = 'SYNC_CreateMissingColumns') | |
DROP PROC [dbo].[SYNC_CreateMissingColumns] | |
GO | |
--CREATE PROCEDURE | |
SET ANSI_NULLS ON | |
GO | |
SET QUOTED_IDENTIFIER ON | |
GO | |
/* |
This file contains 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
--DROP IF ALREADY EXISTS | |
IF EXISTS ( SELECT 1 | |
FROM SYS.procedures | |
WHERE NAME = 'SYNC_ColumnsDefaultValues' ) | |
DROP PROC SYNC_ColumnsDefaultValues | |
GO | |
--CREATE PROCEDURE | |
SET ANSI_NULLS ON | |
GO |
NewerOlder