Posts

Showing posts from February, 2018

SQL Server 2017 features

SQL Server 2017 Database Engine SQL Server 2017 includes many new Database Engine features, enhancements, and performance improvements. ·         CLR assemblies  can now be added to a white list, as a workaround for the  clr strict security  feature described in CTP 2.0.  sp_add_trusted_assembly ,  sp_drop_trusted_assembly , and  sys.trusted_asssemblies  are added to support the white list of trusted assemblies (RC1). ·         Resumable online index rebuild  resumes an online index rebuild operation from where it stopped after a failure (such as a failover to a replica or insufficient disk space), or pauses and later resumes an online index rebuild operation. ·         The  IDENTITY_CACHE  option for ALTER DATABASE SCOPED CONFIGURATION allows you to avoid gaps in the values of identity columns if a server res...

Disk Space Alerts

/* Disk Space Alerts */ CREATE proc [dbo].[USP_Send_DiskSpace] -- ( @To  varchar(200) ,  @CRITICAL int = 10 -- if the freespace(%) is less than @alertvalue, it will send message ) as Begin DECLARE @HOSTNAME VARCHAR(20), @HEAD VARCHAR(100), @BGCOLOR VARCHAR(50), @REC VARCHAR(50), @PRIORITY VARCHAR(10), @FREE VARCHAR(20), @TOTAL VARCHAR(20), @FREE_PER VARCHAR(20), @CHART VARCHAR(2000), @HTML VARCHAR(MAX), @HTMLTEMP VARCHAR(MAX), @TITLE VARCHAR(100), @DRIVE VARCHAR(100), @SQL VARCHAR(MAX) CREATE TABLE #MOUNTVOL (COL1 VARCHAR(500)) INSERT INTO #MOUNTVOL EXEC XP_CMDSHELL 'MOUNTVOL' DELETE #MOUNTVOL WHERE COL1 NOT LIKE '%:%' DELETE #MOUNTVOL WHERE COL1 LIKE '%VOLUME%' DELETE #MOUNTVOL WHERE COL1 IS NULL DELETE #MOUNTVOL WHERE COL1 NOT LIKE '%:%' DELETE #MOUNTVOL WHERE COL1 LIKE '%MOUNTVOL%' DELETE #MOUNTVOL WHERE COL1 LIKE '%RECYCLE%' SELECT L...