<?xml version="1.0" encoding="utf-8"?>
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
  <Body>
    <ReportItems>
      <Textbox Name="Textbox2">
        <CanGrow>true</CanGrow>
        <KeepTogether>true</KeepTogether>
        <Paragraphs>
          <Paragraph>
            <TextRuns>
              <TextRun>
                <Value>="Required Tables have been created in the AdminMonitor Database on " &amp; First(Fields!ServerName.Value, "ServerName")</Value>
                <Style>
                  <FontSize>26pt</FontSize>
                  <Color>White</Color>
                </Style>
              </TextRun>
            </TextRuns>
            <Style>
              <TextAlign>Center</TextAlign>
            </Style>
          </Paragraph>
        </Paragraphs>
        <rd:DefaultName>Textbox2</rd:DefaultName>
        <Top>0.2875in</Top>
        <Left>0.42499in</Left>
        <Height>2.8in</Height>
        <Width>5.475in</Width>
        <Style>
          <Border>
            <Style>None</Style>
          </Border>
          <VerticalAlign>Middle</VerticalAlign>
          <PaddingLeft>2pt</PaddingLeft>
          <PaddingRight>2pt</PaddingRight>
          <PaddingTop>2pt</PaddingTop>
          <PaddingBottom>2pt</PaddingBottom>
        </Style>
      </Textbox>
      <Textbox Name="Textbox1">
        <CanGrow>true</CanGrow>
        <KeepTogether>true</KeepTogether>
        <Paragraphs>
          <Paragraph>
            <TextRuns>
              <TextRun>
                <Value>Back To Deployment Page</Value>
                <Style>
                  <FontSize>22pt</FontSize>
                  <Color>DarkBlue</Color>
                </Style>
              </TextRun>
            </TextRuns>
            <Style>
              <TextAlign>Center</TextAlign>
            </Style>
          </Paragraph>
        </Paragraphs>
        <rd:DefaultName>Textbox1</rd:DefaultName>
        <ActionInfo>
          <Actions>
            <Action>
              <Drillthrough>
                <ReportName>MonitorDeployAdminMonitor</ReportName>
              </Drillthrough>
            </Action>
          </Actions>
        </ActionInfo>
        <Top>3.2375in</Top>
        <Left>0.42499in</Left>
        <Height>0.59167in</Height>
        <Width>5.475in</Width>
        <ZIndex>1</ZIndex>
        <Style>
          <Border>
            <Style>None</Style>
          </Border>
          <BackgroundColor>LightSteelBlue</BackgroundColor>
          <VerticalAlign>Middle</VerticalAlign>
          <PaddingLeft>2pt</PaddingLeft>
          <PaddingRight>2pt</PaddingRight>
          <PaddingTop>2pt</PaddingTop>
          <PaddingBottom>2pt</PaddingBottom>
        </Style>
      </Textbox>
    </ReportItems>
    <Height>4.0125in</Height>
    <Style>
      <Border>
        <Style>None</Style>
      </Border>
      <BackgroundColor>DarkBlue</BackgroundColor>
    </Style>
  </Body>
  <Width>6.5in</Width>
  <Page>
    <LeftMargin>1in</LeftMargin>
    <RightMargin>1in</RightMargin>
    <TopMargin>1in</TopMargin>
    <BottomMargin>1in</BottomMargin>
    <Style />
  </Page>
  <AutoRefresh>0</AutoRefresh>
  <DataSources>
    <DataSource Name="LocalHost">
      <ConnectionProperties>
        <DataProvider>SQL</DataProvider>
        <ConnectString>Data Source=LocalHost;Initial Catalog=AdminMonitor</ConnectString>
        <IntegratedSecurity>true</IntegratedSecurity>
      </ConnectionProperties>
      <rd:SecurityType>Integrated</rd:SecurityType>
      <rd:DataSourceID>e505bd19-6e01-433b-80a2-5631bcb34778</rd:DataSourceID>
    </DataSource>
  </DataSources>
  <DataSets>
    <DataSet Name="ReadWriteLatency">
      <Query>
        <DataSourceName>LocalHost</DataSourceName>
        <CommandText>IF NOT EXISTS(SELECT * FROM adminmonitor.INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'ReadWriteLatency' AND TABLE_SCHEMA = 'dbo')
Begin
USE AdminMonitor

CREATE TABLE AdminMonitor.[dbo].[ReadWriteLatency](
	[DatabaseName] [varchar](100) NOT NULL,
	[DateOfCapture] [datetime] NOT NULL,
	[FileType] [varchar](20) NOT NULL,
	[DriveLetter] [varchar](3) NOT NULL,
	[ReadLatency] [bigint] NOT NULL,
	[WriteLatency] [bigint] NOT NULL,
	[NumberOfReads] [bigint] NOT NULL,
	[NumBytesRead] [bigint] NOT NULL,
	[NumBytesWritten] [bigint] NOT NULL,
	[NumberOfWrites] [bigint] NOT NULL,
	[PhysicalFile] [varchar](200) NOT NULL
) ON [PRIMARY]

/****** Object:  Index [ClusteredDBNameDate]    Script Date: 5/29/2023 6:28:54 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'AdminMonitor.[dbo].[ReadWriteLatency]') AND name = N'ClusteredDBNameDate')
CREATE CLUSTERED INDEX [ClusteredDBNameDate] ON AdminMonitor.[dbo].[ReadWriteLatency]
(
	[DatabaseName] ASC,
	[DateOfCapture] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 79) ON [PRIMARY]
END</CommandText>
      </Query>
    </DataSet>
    <DataSet Name="PerfCountersToCapture">
      <Query>
        <DataSourceName>LocalHost</DataSourceName>
        <CommandText>IF NOT EXISTS(SELECT * FROM adminmonitor.INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'PerformanceCountersToCapture' AND TABLE_SCHEMA = 'dbo')
Begin
Use AdminMonitor

CREATE TABLE AdminMonitor.[dbo].[PerformanceCountersToCapture](
	[CounterID] [int] IDENTITY(1,1) NOT NULL,
	[CounterName] [varchar](100) NOT NULL,
	[ObjectName] [varchar](500) NOT NULL,
	[InstanceName] [varchar](100) NULL,
	[Active] [bit] NULL,
	[CounterDescription] [varchar](500) NULL,
 CONSTRAINT [PK_PerformanceCountersToCapture] PRIMARY KEY CLUSTERED 
(
	[CounterID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 79) ON [PRIMARY]
) ON [PRIMARY]
END</CommandText>
      </Query>
    </DataSet>
    <DataSet Name="PerCountersCaptured">
      <Query>
        <DataSourceName>LocalHost</DataSourceName>
        <CommandText>IF NOT EXISTS(SELECT * FROM adminmonitor.INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'PerfCountersCaptured' AND TABLE_SCHEMA = 'dbo')
Begin
USE AdminMonitor

CREATE TABLE AdminMonitor.[dbo].[PerfCountersCaptured](
	[CounterID] [smallint] NOT NULL,
	[CounterValue] [bigint] NOT NULL,
	[CounterType] [int] NULL,
	[DateTimeOfCapture] [datetime] NOT NULL,
 CONSTRAINT [PK_PerfCountersCaptured] PRIMARY KEY NONCLUSTERED 
(
	[CounterID] ASC,
	[CounterValue] ASC,
	[DateTimeOfCapture] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 79) ON [PRIMARY]
) ON [PRIMARY]

/****** Object:  Index [ClusteredIndex-Date]    Script Date: 5/29/2023 5:23:49 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'AdminMonitor.[dbo].[PerfCountersCaptured]') AND name = N'ClusteredIndex-Date')
CREATE CLUSTERED INDEX [ClusteredIndex-Date] ON AdminMonitor.[dbo].[PerfCountersCaptured]
(
	[DateTimeOfCapture] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
END</CommandText>
      </Query>
    </DataSet>
    <DataSet Name="WaitCaptured">
      <Query>
        <DataSourceName>LocalHost</DataSourceName>
        <CommandText>IF NOT EXISTS(SELECT * FROM adminmonitor.INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'WaitCaptured' AND TABLE_SCHEMA = 'dbo')
Begin
Use AdminMonitor

CREATE TABLE AdminMonitor.[dbo].[WaitCaptured](
	[ID] [bigint] IDENTITY(1,1) NOT NULL,
	[WAITTYPEID] [smallint] NULL,
	[TotalWaitTimeSec] [decimal](19, 9) NULL,
	[ResourceWaitTimeSec] [decimal](19, 9) NULL,
	[SignalWaitTimeSec] [decimal](19, 9) NULL,
	[WaitCount] [bigint] NULL,
	[DateTimeOfCapture] [datetime] NULL,
 CONSTRAINT [PK_WaitCounterCapture] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 79) ON [PRIMARY]
) ON [PRIMARY]
END</CommandText>
      </Query>
    </DataSet>
    <DataSet Name="WaitTypesToCollect">
      <Query>
        <DataSourceName>LocalHost</DataSourceName>
        <CommandText>IF NOT EXISTS(SELECT * FROM adminmonitor.INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'WaitTypesToCollect' AND TABLE_SCHEMA = 'dbo')
Begin
Use AdminMonitor

CREATE TABLE AdminMonitor.[dbo].[WaitTypesToCollect](
	[WaitTypeID] [smallint] IDENTITY(1,1) NOT NULL,
	[WaitTypeName] [varchar](75) NOT NULL,
	[Active] [bit] NOT NULL,
	[WaitDescription] [varchar](500) NULL,
 CONSTRAINT [PK_WaitTypes] PRIMARY KEY CLUSTERED 
(
	[WaitTypeID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 79) ON [PRIMARY]
) ON [PRIMARY]
END</CommandText>
      </Query>
    </DataSet>
    <DataSet Name="ConfigTable">
      <Query>
        <DataSourceName>LocalHost</DataSourceName>
        <CommandText>IF NOT EXISTS(SELECT * FROM adminmonitor.INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'Config' AND TABLE_SCHEMA = 'dbo')
BEGIN
Use AdminMonitor

CREATE TABLE AdminMonitor.[dbo].[Config](
	[ConfigID] [int] IDENTITY(1,1) NOT NULL,
	[ConfigTitle] [varchar](100) NULL,
	[ConfigValue] [varchar](100) NULL,
	[UnitOfMeasure] [varchar](100) NULL,
	[Active] [bit] NULL,
 CONSTRAINT [PK_Config] PRIMARY KEY CLUSTERED 
(
	[ConfigID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 79) ON [PRIMARY]
) ON [PRIMARY]

END</CommandText>
      </Query>
    </DataSet>
    <DataSet Name="WindowsCounters">
      <Query>
        <DataSourceName>LocalHost</DataSourceName>
        <CommandText>IF NOT EXISTS(SELECT * FROM adminmonitor.INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'WindowsCountersCaptured' AND TABLE_SCHEMA = 'dbo')


BEGIN
CREATE TABLE AdminMonitor.[dbo].[WindowsCountersCaptured](
	[WindowsCounterName] [varchar](100) NULL,
	[CounterValue] [decimal](19, 2) NULL,
	[DateTimeOfCapture] [datetime] NULL
) ON [PRIMARY]


CREATE CLUSTERED INDEX [Clustered Name and Value] ON AdminMonitor.[dbo].[WindowsCountersCaptured]
(
	[WindowsCounterName] ASC,
	[CounterValue] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 79) ON [PRIMARY]

END</CommandText>
      </Query>
    </DataSet>
    <DataSet Name="ServerName">
      <Query>
        <DataSourceName>LocalHost</DataSourceName>
        <CommandText>Select @@servername AS 'ServerName'</CommandText>
      </Query>
      <Fields>
        <Field Name="ServerName">
          <DataField>ServerName</DataField>
          <rd:TypeName>System.String</rd:TypeName>
        </Field>
      </Fields>
    </DataSet>
    <DataSet Name="DeadLockTables">
      <Query>
        <DataSourceName>LocalHost</DataSourceName>
        <CommandText>IF NOT EXISTS(SELECT * FROM adminmonitor.INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'DeadlockCount' AND TABLE_SCHEMA = 'dbo')
BEGIN
USE [AdminMonitor]


CREATE TABLE AdminMonitor.[dbo].[DeadlockCount](
	[DateOfCheck] [datetime] NOT NULL,
	[NumberOfEvents] [int] NOT NULL
) ON [PRIMARY]

/****** Object:  Index [ClusteredIndex-EventDate]    Script Date: 5/29/2023 5:23:49 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[DeadlockCount]') AND name = N'ClusteredIndex-EventDate')
CREATE CLUSTERED INDEX [ClusteredIndex-EventDate] ON AdminMonitor.[dbo].[DeadlockCount]
(
	[DateOfCheck] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 79) ON [PRIMARY]

END

IF NOT EXISTS(SELECT * FROM adminmonitor.INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'DeadlockDetail' AND TABLE_SCHEMA = 'dbo')

Begin

CREATE TABLE AdminMonitor.[dbo].[DeadlockDetail](
	[LocalTimeOfDeadLock] [datetime] NOT NULL,
	[UTCTimeOfDeadlock] [datetime] NOT NULL,
	[DatabaseName] [varchar](100) NULL
) ON [PRIMARY]


/****** Object:  Index [ClusteredIndex-LocalDateTime]    Script Date: 5/29/2023 5:23:49 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'AdminMonitor.[dbo].[DeadlockDetail]') AND name = N'ClusteredIndex-LocalDateTime')
CREATE CLUSTERED INDEX [ClusteredIndex-LocalDateTime] ON AdminMonitor.[dbo].[DeadlockDetail]
(
	[LocalTimeOfDeadLock] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 79) ON [PRIMARY]
ENd</CommandText>
      </Query>
    </DataSet>
    <DataSet Name="BlockingTables">
      <Query>
        <DataSourceName>LocalHost</DataSourceName>
        <CommandText>USE [AdminMonitor]

IF NOT EXISTS(SELECT * FROM adminmonitor.INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'BlockingCount' AND TABLE_SCHEMA = 'dbo')
Begin

CREATE TABLE AdminMonitor.[dbo].[BlockingCount](
	[DateOfCheck] [datetime] NOT NULL,
	[NumberOfEvents] [int] NOT NULL
) ON [PRIMARY]

/****** Object:  Index [ClusteredIndex-DateOfCheck]    Script Date: 5/29/2023 5:23:49 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'AdminMonitor.[dbo].[BlockingCount]') AND name = N'ClusteredIndex-DateOfCheck')
CREATE CLUSTERED INDEX [ClusteredIndex-DateOfCheck] ON AdminMonitor.[dbo].[BlockingCount]
(
	[DateOfCheck] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 80) ON [PRIMARY]

END

IF NOT EXISTS(SELECT * FROM adminmonitor.INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'BlockingDetail' AND TABLE_SCHEMA = 'dbo')
BEGIN
CREATE TABLE AdminMonitor.[dbo].[BlockingDetail](
	[LocalTimeOfBlocking] [datetime] NOT NULL,
	[UTCTimeOfBlocking] [datetime] NOT NULL,
	[DatabaseName] [varchar](100) NULL
) ON [PRIMARY]

/****** Object:  Index [ClusteredIndex-Date]    Script Date: 5/29/2023 5:23:49 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[BlockingDetail]') AND name = N'ClusteredIndex-Date')
CREATE CLUSTERED INDEX [ClusteredIndex-Date] ON AdminMonitor.[dbo].[BlockingDetail]
(
	[LocalTimeOfBlocking] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 80) ON [PRIMARY]
END</CommandText>
      </Query>
    </DataSet>
    <DataSet Name="BaselineTable">
      <Query>
        <DataSourceName>LocalHost</DataSourceName>
        <CommandText>IF NOT EXISTS(SELECT * FROM adminmonitor.INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'Baseline' AND TABLE_SCHEMA = 'dbo')

BEGIN
USE [AdminMonitor]
CREATE TABLE AdminMonitor.[dbo].[Baselines](
	[BaseLineID] [int] IDENTITY(1,1) NOT NULL,
	[CounterName] [varchar](100) NULL,
	[BaselineValue] [decimal](19, 2) NULL,
	[DateOfBaseLine] [datetime] NULL,
	[NumberOfCapturesUse] [int] NULL,
 CONSTRAINT [PK_Baseline] PRIMARY KEY CLUSTERED 
(
	[BaseLineID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 91) ON [PRIMARY]
) ON [PRIMARY]
END
</CommandText>
      </Query>
    </DataSet>
    <DataSet Name="ServerActivity">
      <Query>
        <DataSourceName>LocalHost</DataSourceName>
        <CommandText>IF NOT EXISTS(SELECT * FROM adminmonitor.INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'ServerActivity' AND TABLE_SCHEMA = 'dbo')
Begin
Use AdminMonitor

CREATE TABLE AdminMonitor.[dbo].[ServerActivity](
	[SpidCount] [int] NULL,
	[DatabaseID] [smallint] NULL,
	[HostName] [varchar](100) NULL,
	[ProgramName] [varchar](100) NULL,
	[DateTimeOfCapture] [datetime] NULL
) ON [PRIMARY]

/****** Object:  Index [ClusteredIndex-HostName]    Script Date: 5/29/2023 6:28:54 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'AdminMonitor.[dbo].[ServerActivity]') AND name = N'ClusteredIndex-HostName')
CREATE CLUSTERED INDEX [ClusteredIndex-HostName] ON AdminMonitor.[dbo].[ServerActivity]
(
	[HostName] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 91) ON [PRIMARY]
END</CommandText>
      </Query>
    </DataSet>
    <DataSet Name="AdditionalIndexes">
      <Query>
        <DataSourceName>LocalHost</DataSourceName>
        <CommandText>USE AdminMonitor

IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'Adminmonitor.[dbo].[BlockingDetail]') AND name = N'NonClusteredIndex-DatabaseName')
CREATE NONCLUSTERED INDEX [NonClusteredIndex-DatabaseName] ON adminmonitor.[dbo].[BlockingDetail]
(
	[DatabaseName] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 80) ON [PRIMARY]

/****** Object:  Index [Unique CounterObjectInstance Name]    Script Date: 5/29/2023 6:28:54 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'adminmonitor.[dbo].[PerformanceCountersToCapture]') AND name = N'Unique CounterObjectInstance Name')
CREATE UNIQUE NONCLUSTERED INDEX [Unique CounterObjectInstance Name] ON adminmonitor.[dbo].[PerformanceCountersToCapture]
(
	[CounterName] ASC,
	[ObjectName] ASC,
	[InstanceName] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 80) ON [PRIMARY]

/****** Object:  Index [NonClusteredIndex-Date]    Script Date: 5/29/2023 6:28:54 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'adminmonitor.[dbo].[ReadWriteLatency]') AND name = N'NonClusteredIndex-Date')
CREATE NONCLUSTERED INDEX [NonClusteredIndex-Date] ON adminmonitor.[dbo].[ReadWriteLatency]
(
	[DateOfCapture] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]

/****** Object:  Index [NonClustered DataOfCapture]    Script Date: 5/29/2023 6:28:54 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'adminmonitor.[dbo].[ServerActivity]') AND name = N'NonClustered DataOfCapture')
CREATE NONCLUSTERED INDEX [NonClustered DataOfCapture] ON adminmonitor.[dbo].[ServerActivity]
(
	[ProgramName] ASC,
	[DateTimeOfCapture] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 91) ON [PRIMARY]

/****** Object:  Index [NonClusteredIndex-Date]    Script Date: 5/29/2023 6:28:54 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'adminmonitor.[dbo].[WaitCaptured]') AND name = N'NonClusteredIndex-Date')
CREATE NONCLUSTERED INDEX [NonClusteredIndex-Date] ON adminmonitor.[dbo].[WaitCaptured]
(
	[DateTimeOfCapture] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]

/****** Object:  Index [Unigue WaitType Name]    Script Date: 5/29/2023 6:28:54 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'adminmonitor.[dbo].[WaitTypesToCollect]') AND name = N'Unigue WaitType Name')
CREATE UNIQUE NONCLUSTERED INDEX [Unigue WaitType Name] ON adminmonitor.[dbo].[WaitTypesToCollect]
(
	[WaitTypeName] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 80) ON [PRIMARY]

/****** Object:  Index [NonClusteredIndex-Datecaptured]    Script Date: 5/29/2023 6:28:54 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'adminmonitor.[dbo].[WindowsCountersCaptured]') AND name = N'NonClusteredIndex-Datecaptured')
CREATE NONCLUSTERED INDEX [NonClusteredIndex-Datecaptured] ON adminmonitor.[dbo].[WindowsCountersCaptured]
(
	[DateTimeOfCapture] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]


USE [AdminMonitor]


SET ANSI_PADDING ON


/****** Object:  Index [NonClusteredIndex-ConfigTitle]    Script Date: 6/7/2023 9:33:45 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'AdminMonitor.[dbo].[Config]') AND name = N'NonClusteredIndex-ConfigTitle')
CREATE UNIQUE NONCLUSTERED INDEX [NonClusteredIndex-ConfigTitle] ON AdminMonitor.[dbo].[Config]
(
	[ConfigTitle] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 91) ON [PRIMARY]
</CommandText>
      </Query>
    </DataSet>
    <DataSet Name="DroppedLoginUsers">
      <Query>
        <DataSourceName>LocalHost</DataSourceName>
        <CommandText>USE [AdminMonitor]

IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'AdminMonitor.[dbo].[DroppedDatabaseUsers]') AND type in (N'U'))
BEGIN
CREATE TABLE AdminMonitor.[dbo].[DroppedDatabaseUsers](
	[DroppedUserID] [int] IDENTITY(1,1) NOT NULL,
	[DateTimeOfDelete] [datetime] NULL,
	[DroppedUser] [varchar](500) NULL,
	[DeletedBy] [varchar](100) NULL,
	[DatabaseName] [varchar](200) NULL
) ON [PRIMARY]
END

/****** Object:  Index [ClusteredIndex-DateTImeUser]    Script Date: 6/1/2023 8:28:20 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'AdminMonitor.[dbo].[DroppedDatabaseUsers]') AND name = N'ClusteredIndex-DateTImeUser')
CREATE CLUSTERED INDEX [ClusteredIndex-DateTImeUser] ON AdminMonitor.[dbo].[DroppedDatabaseUsers]
(
	[DateTimeOfDelete] ASC,
	[DroppedUser] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 91) ON [PRIMARY]

IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'AdminMonitor.[dbo].[DroppedLogins]') AND type in (N'U'))
BEGIN
CREATE TABLE AdminMonitor.[dbo].[DroppedLogins](
	[DropLoginID] [int] IDENTITY(1,1) NOT NULL,
	[TimeOfDelete] [datetime] NULL,
	[DeletedLogin] [varchar](500) NULL,
	[WhoDeletedIt] [varchar](200) NULL,
 CONSTRAINT [PK_DroppedLogins] PRIMARY KEY CLUSTERED 
(
	[DropLoginID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 91) ON [PRIMARY]
) ON [PRIMARY]
END

/****** Object:  Index [NonClusteredIndex-ID]    Script Date: 6/1/2023 8:28:20 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'AdminMonitor.[dbo].[DroppedDatabaseUsers]') AND name = N'NonClusteredIndex-ID')
CREATE UNIQUE NONCLUSTERED INDEX [NonClusteredIndex-ID] ON AdminMonitor.[dbo].[DroppedDatabaseUsers]
(
	[DroppedUserID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 91) ON [PRIMARY]

/****** Object:  Index [NonClusteredIndex-DateOfDelete]    Script Date: 6/1/2023 8:28:20 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'AdminMonitor.[dbo].[DroppedLogins]') AND name = N'NonClusteredIndex-DateOfDelete')
CREATE NONCLUSTERED INDEX [NonClusteredIndex-DateOfDelete] ON AdminMonitor.[dbo].[DroppedLogins]
(
	[TimeOfDelete] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 91) ON [PRIMARY]</CommandText>
      </Query>
    </DataSet>
    <DataSet Name="Databasegrowth">
      <Query>
        <DataSourceName>LocalHost</DataSourceName>
        <CommandText>IF NOT EXISTS(SELECT * FROM adminmonitor.INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'DatabaseSize' AND TABLE_SCHEMA = 'dbo')
BEGIN
USE [AdminMonitor]

CREATE TABLE AdminMonitor.[dbo].[DatabaseSize](
	[DatabaseName] [varchar](100) NULL,
	[LogSizeMB] [decimal](10, 2) NULL,
	[DataSizeMB] [decimal](10, 2) NULL,
	[TotalSizeMB] [decimal](10, 2) NULL,
	[DateOfCapture] [datetime] NULL
) ON [PRIMARY]


SET ANSI_PADDING ON

/****** Object:  Index [ClusteredIndex-DatabaseName]    Script Date: 6/7/2023 6:25:57 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'AdminMonitor.[dbo].[DatabaseSize]') AND name = N'ClusteredIndex-DatabaseName')
CREATE CLUSTERED INDEX [ClusteredIndex-DatabaseName] ON AdminMonitor.[dbo].[DatabaseSize]
(
	[DatabaseName] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 91) ON [PRIMARY]

/****** Object:  Index [NonClusteredIndex-DataOfCapture]    Script Date: 6/7/2023 6:25:57 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'AdminMonitor.[dbo].[DatabaseSize]') AND name = N'NonClusteredIndex-DataOfCapture')
CREATE NONCLUSTERED INDEX [NonClusteredIndex-DataOfCapture] ON AdminMonitor.[dbo].[DatabaseSize]
(
	[DateOfCapture] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 91) ON [PRIMARY]
END</CommandText>
      </Query>
    </DataSet>
    <DataSet Name="QueryTimeout">
      <Query>
        <DataSourceName>LocalHost</DataSourceName>
        <CommandText>IF NOT EXISTS(SELECT * FROM adminmonitor.INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'QueryTimeOut' AND TABLE_SCHEMA = 'dbo')
Begin
USE [AdminMonitor]

CREATE TABLE AdminMonitor.[dbo].[QueryTimeOut](
	[LocalTimeOfTimeout] [datetime] NULL,
	[TimeOfTimeOut(UTC)] [datetime] NULL,
	[Statement] [varchar](500) NULL,
	[Duration] [int] NULL,
	[UserName] [varchar](200) NULL,
	[DBName] [varchar](200) NULL
) ON [PRIMARY]

/****** Object:  Index [ClusteredIndex-LocalTime]    Script Date: 6/11/2023 9:21:25 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'AdminMonitor.[dbo].[QueryTimeOut]') AND name = N'ClusteredIndex-LocalTime')
CREATE CLUSTERED INDEX [ClusteredIndex-LocalTime] ON AdminMonitor.[dbo].[QueryTimeOut]
(
	[LocalTimeOfTimeout] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 91) ON [PRIMARY]

SET ANSI_PADDING ON

/****** Object:  Index [NonClusteredIndex-DBName]    Script Date: 6/11/2023 9:21:25 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'AdminMonitor.[dbo].[QueryTimeOut]') AND name = N'NonClusteredIndex-DBName')
CREATE NONCLUSTERED INDEX [NonClusteredIndex-DBName] ON AdminMonitor.[dbo].[QueryTimeOut]
(
	[DBName] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 91) ON [PRIMARY]

/****** Object:  Index [NonClusteredIndex-UserName]    Script Date: 6/11/2023 9:21:25 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'AdminMonitor.[dbo].[QueryTimeOut]') AND name = N'NonClusteredIndex-UserName')
CREATE NONCLUSTERED INDEX [NonClusteredIndex-UserName] ON AdminMonitor.[dbo].[QueryTimeOut]
(
	[UserName] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 91) ON [PRIMARY]

END</CommandText>
      </Query>
    </DataSet>
  </DataSets>
  <rd:ReportUnitType>Inch</rd:ReportUnitType>
  <rd:ReportID>e1dee177-e9dc-4dfa-ac6e-19693e53d910</rd:ReportID>
</Report>