Our end goal is to be able to see something like this.
What we will need.
1. A UCMA application
2. A SQL table
3. A website or program to report the results
Today we are going to start with the SQL table since without it, we have no where to store our data. Here is what I propose for a table to store our data.
CREATE TABLE [dbo].[timeclock_table](
[rowguid] [uniqueidentifier] ROWGUIDCOL NOT NULL CONSTRAINT [DF_timeclock_table_rowguid] DEFAULT (newid()),
[uri] [varchar](250) NULL,
[sdate] [datetime] NULL CONSTRAINT [DF_timeclock_table_sdate] DEFAULT (getdate()),
[edate] [datetime] NULL,
[seconds] [int] NULL,
[state] [varchar](50) NULL,
CONSTRAINT [PK_timeclock_table] PRIMARY KEY CLUSTERED
(
[rowguid] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
We will add 3 indexes to our table.
/****** Object: Index [PK_timeclock_table] Script Date: 3/5/2016 7:02:47 AM ******/
ALTER TABLE [dbo].[timeclock_table] ADD CONSTRAINT [PK_timeclock_table] PRIMARY KEY CLUSTERED
(
[rowguid] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
/****** Object: Index [NonClusteredIndex-20160303-064705] Script Date: 3/5/2016 7:03:18 AM ******/
CREATE NONCLUSTERED INDEX [NonClusteredIndex-20160303-064705] ON [dbo].[timeclock_table]
(
[uri] 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) ON [PRIMARY]
/****** Object: Index [NonClusteredIndex-20160303-082645] Script Date: 3/5/2016 7:03:46 AM ******/
CREATE NONCLUSTERED INDEX [NonClusteredIndex-20160303-082645] ON [dbo].[timeclock_table]
(
[state] 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) ON [PRIMARY]
Things of note on the SQL table;
1. We are setting a default on sdate so when the record is inserted (a new status is detected) it is stamped with the default getdate() which is NOW.
2. Indexes on URI and STATE are created to ensure fast updates and reporting.
Next week will dive into the UCMA application that will populate our table.
Doug Routledge, C# Lync, Skype for Business, SQL, Exchange, UC Developer BridgeOC Twitter - @droutledge @ndbridge |
No comments:
Post a Comment
Any spam comments will be deleted and your user account will be disabled.