Le Kevin dot com

photographic-poetic-musical horizon

Browsing Posts tagged databases

USE [master] GO /****** Object: StoredProcedure [dbo].[spShrinkAllDatabases] Script Date: 08/12/2011 15:40:15 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO — ============================================= — Author: Dan Sutton — Create date: 06/14/2011 — Description: Reindex all tables and shrink Logs and Data Files in Server — ============================================= CREATE PROCEDURE [dbo].[spShrinkAllDatabases] AS BEGIN SET NOCOUNT ON; DECLARE @dbname [...]

It backs up with an expiration of 30 days, but a year for anything on the first of the month. Emails if it fails… (assume that you have sql email profile already setup) CREATE PROCEDURE spBackupAllDatabases AS BEGIN SET NOCOUNT ON; declare @db varchar(50) declare @d varchar(100) declare @n varchar(100) declare @rd int set @rd=case [...]