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

HowTo: Grow a very large MS-SQL Log File

Microsoft SQL Server 2005 has a nasty habit of creating thousands or hundreds of thousands of logical log files even though you set Autogrowth to a large size, say 8GB. The following SQL code automates manually growing your log file by 8GB increments. When using the ALTER DATABASE command to modify log file size manually

Read More

Remove Custom Menu Bars from Microsoft Access 2003

Run the following command from the VB Immediate Window (CTRL-G) inside Microsoft Access to remove any custom command bars present in the currently loaded database: CurrentDb.Execute “DELETE * FROM MSysAccessStorage WHERE ParentId IN (SELECT msa.Id FROM MSysAccessStorage AS msa WHERE msa.Name = ‘Cmdbars’;);” Execute the following code to completely remove all custom command bars