Tool for scripting SQL Server Agent Jobs

I recently created an open-source tool that will create a T-SQL script file containing code to recreate whatever jobs you presently have in SQL Server Agent for any given SQL Instance, up to SQL Server 2012 SP1. The tool requires SQL Server 2012 SP1 Server Management Objects and SQL Server System CLR Types: SQL Server

Read More

SQL Server 2005 Mirroring – disable/enable T-SQL Scripts

USE [MagellanSQLMonitor] GO /****** Object: StoredProcedure [dbo].[EnableMirroring] Script Date: 05/16/2012 13:59:14 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE PROCEDURE [dbo].[EnableMirroring] AS BEGIN DECLARE @SQL NVARCHAR(MAX); DECLARE CUR CURSOR FOR SELECT ‘ALTER DATABASE ‘ + D.NAME + ‘ SET PARTNER = ”TCP://machine1.domain.inet:5022”’ FROM machine2.MASTER.SYS.DATABASES D WHERE STATE=1; OPEN CUR; FETCH NEXT FROM CUR

Read More