Databases Reference
In-Depth Information
[countryCode] [varchar](128) NULL,
[lastBootUpTime] [smalldatetime] NULL,
[locale] [varchar](128) NULL,
[OS] [varchar](128) NULL,
[version] [varchar](128) NULL,
[servicePackMajorVersion] [varchar](10) NULL,
[servicePackMinorVersion] [varchar](10) NULL,
[buildNumber] [varchar](20) NULL,
[installDate] [datetime] NULL,
[totalVisibleMemorySize] [bigint] NULL,
[totalVirtualMemorySize] [bigint] NULL,
[pagingFileSize] [bigint] NULL,
[IP1] [varchar](128) NULL,
[IP2] [varchar](128) NULL,
[IP3] [varchar](128) NULL,
[IP4] [varchar](128) NULL,
[IP5] [varchar](128) NULL,
[IP6] [varchar](128) NULL,
[createDate] [smalldatetime] NOT NULL,
[updateDate] [smalldatetime] NOT NULL,
) ON [PRIMARY]
GO
We also need a stored procedure, uspUpsertHosts , to insert a host record when the host does not
exist in the inventory, or update a host record when the host already exists. This stored procedure
will be called later in the Upsert-Host.ps1 script to manage the Hosts table. The following script,
uspUpsertHosts.sql , is used to create the stored procedure uspUpsertHosts :
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
USE [SQL_Inventory]
GO
IF EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[uspUpsertHosts]') AND type in (N'P', N'PC'))
DROP PROCEDURE [DBO].[uspUpsertHosts]
GO
CREATE PROCEDURE [dbo].[uspUpsertHosts]
@hostName [varchar] (128),
@region [char] (2),
@location [char] (2),
@description [varchar] (500),
@primaryBU [varchar] (128),
@timeZone [varchar] (128),
@enableDaylightSavingsTime
[bit],
@domain [varchar] (128),
@manufacturer [varchar] (128),
@model [varchar] (128),
@systemType [varchar] (128),
@systemStartupOptions [varchar] (128),
@numberOfProcessors [tinyint],
@numberOfLogicalProcessors
[tinyint],
@totalPhysicalMemory
[bigint],
@countryCode
[varchar] (128),
Search WWH ::




Custom Search