Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| vendors:cisco:uc:ucce:baselinereskiller [2023/06/23 09:30] – [Database] gerardorourke | vendors:cisco:uc:ucce:baselinereskiller [2023/07/31 10:05] (current) – [Python Scripts] gerardorourke | ||
|---|---|---|---|
| Line 177: | Line 177: | ||
| ===== Database ===== | ===== Database ===== | ||
| + | ==== Database Views ==== | ||
| *Add UCCE AW SQL Server as a linked server | *Add UCCE AW SQL Server as a linked server | ||
| *When adding - on the security tab, set "Be made using this security context" | *When adding - on the security tab, set "Be made using this security context" | ||
| Line 255: | Line 256: | ||
| FROM FROM [ucce-hds-a.example.com].[ucce_awdb].[dbo].[t_Agent_Team_Member] t | FROM FROM [ucce-hds-a.example.com].[ucce_awdb].[dbo].[t_Agent_Team_Member] t | ||
| </ | </ | ||
| + | |||
| + | ==== Database Tables ==== | ||
| + | <code sql> | ||
| + | USE [reskiller_db] | ||
| + | GO | ||
| + | |||
| + | /****** Object: | ||
| + | SET ANSI_NULLS ON | ||
| + | GO | ||
| + | |||
| + | SET QUOTED_IDENTIFIER ON | ||
| + | GO | ||
| + | |||
| + | CREATE TABLE [dbo].[Department]( | ||
| + | [DepartmentID] [int] NOT NULL, | ||
| + | [DepartmentName] [varchar](50) NOT NULL, | ||
| + | [Supervisor] [varchar](50) NOT NULL, | ||
| + | [Password] [varchar](50) NOT NULL, | ||
| + | [ScheduleID] [int] NULL, | ||
| + | [Active] [char](1) NOT NULL | ||
| + | ) ON [PRIMARY] | ||
| + | GO | ||
| + | |||
| + | ALTER TABLE [dbo].[Department] ADD CONSTRAINT [DF_Department_Active] | ||
| + | GO | ||
| + | </ | ||
| + | |||
| + | <code sql> | ||
| + | USE [reskiller_db] | ||
| + | GO | ||
| + | |||
| + | /****** Object: | ||
| + | SET ANSI_NULLS ON | ||
| + | GO | ||
| + | |||
| + | SET QUOTED_IDENTIFIER ON | ||
| + | GO | ||
| + | |||
| + | CREATE TABLE [dbo].[Agent_Team_Department]( | ||
| + | [AgentTeamID] [int] NOT NULL, | ||
| + | [DepartmentID] [int] NOT NULL, | ||
| + | [Active] [char](1) NOT NULL, | ||
| + | | ||
| + | ( | ||
| + | [AgentTeamID] ASC | ||
| + | )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | ||
| + | ) ON [PRIMARY] | ||
| + | GO | ||
| + | |||
| + | ALTER TABLE [dbo].[Agent_Team_Department] ADD CONSTRAINT [DF_Agent_Team_Department_Active] | ||
| + | GO | ||
| + | </ | ||
| + | |||
| + | <code sql> | ||
| + | USE [reskiller_db] | ||
| + | GO | ||
| + | |||
| + | /****** Object: | ||
| + | SET ANSI_NULLS ON | ||
| + | GO | ||
| + | |||
| + | SET QUOTED_IDENTIFIER ON | ||
| + | GO | ||
| + | |||
| + | CREATE TABLE [dbo].[Agent_Team_Skill_Group]( | ||
| + | [AgentTeamID] [int] NOT NULL, | ||
| + | [SkillTargetID] [int] NOT NULL | ||
| + | ) ON [PRIMARY] | ||
| + | GO | ||
| + | </ | ||
| + | |||
| + | <code sql> | ||
| + | USE [reskiller_db] | ||
| + | GO | ||
| + | |||
| + | /****** Object: | ||
| + | SET ANSI_NULLS ON | ||
| + | GO | ||
| + | |||
| + | SET QUOTED_IDENTIFIER ON | ||
| + | GO | ||
| + | |||
| + | CREATE TABLE [dbo].[Log]( | ||
| + | [ID] [int] IDENTITY(1, | ||
| + | [DateTime] [datetime] NOT NULL, | ||
| + | [SevLevel] [int] NOT NULL, | ||
| + | [Data] [nvarchar](max) NOT NULL, | ||
| + | | ||
| + | ( | ||
| + | [ID] ASC | ||
| + | )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | ||
| + | ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] | ||
| + | GO | ||
| + | |||
| + | ALTER TABLE [dbo].[Log] ADD CONSTRAINT [DF_Log_DateTime] | ||
| + | GO | ||
| + | </ | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| Line 526: | Line 631: | ||
| print(" | print(" | ||
| </ | </ | ||
| + | |||
| + | ===== Troubleshooting ===== | ||
| + | |||
| + | If the script works OK as but not when running as a sheduled script - run the script under the same account and see if the issue occur. | ||
| + | |||
| + | {{: | ||
| + | |||