Primary Key Violation when inserting records in table

  • I have stored procedure which inserting records in two table.both table have primary key and when i am running that procedure it's give me error

    Msg 2627, Level 14, State 1, Server SSHEIKH-DW7, Line 1

    Violation of PRIMARY KEY constraint 'PK_T_TBLMAINT_TABLES'. Cannot insert duplicate key in object 'Common.t_TblMaint_Tables'. The duplicate key value is (t_Employee_JobTitle).

    The statement has been terminated.

    Msg 2627, Level 14, State 1, Server SSHEIKH-DW7, Line 1

    Violation of PRIMARY KEY constraint 'PK_T_TBLMAINT_COL_COMMENTS'. Cannot insert duplicate key in object 'Common.t_TblMaint_Col_Comments'. The duplicate key value is (t_Employee_JobTitle, JobTitleID).

    The statement has been terminated.

    below I am give you strucature of my table as well my stored procedure and my script which Iam running and give me error above.

    Give me solution.I tried drop and re create constraint but now work out still give me error.

    Msg 1505, Level 16, State 1, Line 3

    The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name 'Common.t_TblMaint_Col_Comments' and the index name 'PK_T_TBLMAINT_COL_COMMENTS'. The duplicate key value is (t_Department, DeptCode).

    Msg 1750, Level 16, State 0, Line 3

    Could not create constraint. See previous errors.

    /****** Object: Table [Common].[t_TblMaint_Col_Comments] Script Date: 06/07/2013 12:26:44 ******/

    IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[Common].[t_TblMaint_Col_Comments]') AND type in (N'U'))

    DROP TABLE [Common].[t_TblMaint_Col_Comments]

    GO

    /****** Object: Table [Common].[t_TblMaint_Col_Comments] Script Date: 06/07/2013 12:26:44 ******/

    SET ANSI_NULLS ON

    GO

    SET QUOTED_IDENTIFIER ON

    GO

    SET ANSI_PADDING ON

    GO

    CREATE TABLE [Common].[t_TblMaint_Col_Comments](

    [CCOM_ID] [int] IDENTITY(1,1) NOT NULL,

    [TableName] [varchar](50) NOT NULL,

    [ColumnName] [varchar](50) NOT NULL,

    [ColumnComment] [varchar](100) NULL,

    [ControlType] [varchar](50) NULL,

    [ColumnAlias] [varchar](50) NULL

    ) ON [PRIMARY]

    GO

    SET ANSI_PADDING OFF

    GO

    IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_t_TblMaint_Tables_IsActive]') AND type = 'D')

    BEGIN

    ALTER TABLE [Common].[t_TblMaint_Tables] DROP CONSTRAINT [DF_t_TblMaint_Tables_IsActive]

    END

    GO

    /****** Object: Table [Common].[t_TblMaint_Tables] Script Date: 06/07/2013 12:28:11 ******/

    IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[Common].[t_TblMaint_Tables]') AND type in (N'U'))

    DROP TABLE [Common].[t_TblMaint_Tables]

    GO

    /****** Object: Table [Common].[t_TblMaint_Tables] Script Date: 06/07/2013 12:28:11 ******/

    SET ANSI_NULLS ON

    GO

    SET QUOTED_IDENTIFIER ON

    GO

    SET ANSI_PADDING ON

    GO

    CREATE TABLE [Common].[t_TblMaint_Tables](

    [Tbl_id] [int] IDENTITY(1,1) NOT NULL,

    [TableName] [varchar](50) NOT NULL,

    [TableComment] [varchar](100) NULL,

    [DatabaseName] [varchar](50) NULL,

    [SchemaName] [varchar](50) NULL,

    [TableIDField] [varchar](50) NULL,

    [IsActive] [bit] NULL

    ) ON [PRIMARY]

    GO

    SET ANSI_PADDING OFF

    GO

    ALTER TABLE [Common].[t_TblMaint_Tables] ADD CONSTRAINT [DF_t_TblMaint_Tables_IsActive] DEFAULT ((1)) FOR [IsActive]

    GO

    /****** Object: Table [Common].[t_TblMaint_Col_DropDownData] Script Date: 06/07/2013 12:28:55 ******/

    IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[Common].[t_TblMaint_Col_DropDownData]') AND type in (N'U'))

    DROP TABLE [Common].[t_TblMaint_Col_DropDownData]

    GO

    /****** Object: Table [Common].[t_TblMaint_Col_DropDownData] Script Date: 06/07/2013 12:28:55 ******/

    SET ANSI_NULLS ON

    GO

    SET QUOTED_IDENTIFIER ON

    GO

    SET ANSI_PADDING ON

    GO

    CREATE TABLE [Common].[t_TblMaint_Col_DropDownData](

    [DDD_ID] [int] IDENTITY(1,1) NOT NULL,

    [CCOM_ID] [int] NULL,

    [LookupTableName] [varchar](50) NULL,

    [IDFieldName] [varchar](50) NULL,

    [ValueFieldName] [varchar](50) NULL,

    [RequiresEmptyValue] [varchar](1) NULL

    ) ON [PRIMARY]

    GO

    SET ANSI_PADDING OFF

    GO

    /****** Object: Table [Common].[t_TblMaint_Tables] Script Date: 06/07/2013 12:37:14 ******/

    SET IDENTITY_INSERT [Common].[t_TblMaint_Tables] ON

    INSERT [Common].[t_TblMaint_Tables] ([Tbl_id], [TableName], [TableComment], [DatabaseName], [SchemaName], [TableIDField], [IsActive]) VALUES (24, N'FacilityCodeXref', N'Facility: code mapping for Office facilities', N'Vision', N'Dbo', N'ID', 1)

    INSERT [Common].[t_TblMaint_Tables] ([Tbl_id], [TableName], [TableComment], [DatabaseName], [SchemaName], [TableIDField], [IsActive]) VALUES (21, N't_Budget', N'Doctor: Budget', N'Vision', N'Common', N'ItemID', 1)

    INSERT [Common].[t_TblMaint_Tables] ([Tbl_id], [TableName], [TableComment], [DatabaseName], [SchemaName], [TableIDField], [IsActive]) VALUES (33, N't_CallCenter_VisionLogin', N'Call Center: Vision logins of Call Center agents', N'Vision', N'dbo', N'itemID', 1)

    INSERT [Common].[t_TblMaint_Tables] ([Tbl_id], [TableName], [TableComment], [DatabaseName], [SchemaName], [TableIDField], [IsActive]) VALUES (35, N't_Department', N'Department: Department List', N'Vision', N'Common', N'DeptID', 1)

    INSERT [Common].[t_TblMaint_Tables] ([Tbl_id], [TableName], [TableComment], [DatabaseName], [SchemaName], [TableIDField], [IsActive]) VALUES (16, N't_Doctor', N'Doctor: general information', N'Vision', N'Common', N'DoctorID', 1)

    INSERT [Common].[t_TblMaint_Tables] ([Tbl_id], [TableName], [TableComment], [DatabaseName], [SchemaName], [TableIDField], [IsActive]) VALUES (20, N't_Doctor_FTE', N'Doctor: FTE settings', N'Vision', N'Common', N'ItemID', 1)

    INSERT [Common].[t_TblMaint_Tables] ([Tbl_id], [TableName], [TableComment], [DatabaseName], [SchemaName], [TableIDField], [IsActive]) VALUES (17, N't_Doctor_Role', N'Doctor: definition of roles', N'Vision', N'Common', N'RoleID', 1)

    INSERT [Common].[t_TblMaint_Tables] ([Tbl_id], [TableName], [TableComment], [DatabaseName], [SchemaName], [TableIDField], [IsActive]) VALUES (31, N't_Doctor_Split', N'Doctor: Doctor Split', N'Vision', N'Dbo', N'DocSplitID', 1)

    INSERT [Common].[t_TblMaint_Tables] ([Tbl_id], [TableName], [TableComment], [DatabaseName], [SchemaName], [TableIDField], [IsActive]) VALUES (34, N't_Doctor_Team', N'Doctor: Team Assignment', N'Vision', N'Common', N'ItemID', 1)

    INSERT [Common].[t_TblMaint_Tables] ([Tbl_id], [TableName], [TableComment], [DatabaseName], [SchemaName], [TableIDField], [IsActive]) VALUES (36, N't_Employee_JobTitle', N'Job Titles:Job Titles to Department ', N'Vision', N'Common', N'JobTitleID', 1)

    INSERT [Common].[t_TblMaint_Tables] ([Tbl_id], [TableName], [TableComment], [DatabaseName], [SchemaName], [TableIDField], [IsActive]) VALUES (18, N't_Facility', N'Facility: General information', N'Vision', N'Common', N'FacilityID', 1)

    INSERT [Common].[t_TblMaint_Tables] ([Tbl_id], [TableName], [TableComment], [DatabaseName], [SchemaName], [TableIDField], [IsActive]) VALUES (19, N't_Facility_ExamRoom', N'Facility: Exam rooms', N'Vision', N'Common', N'RecordID', 1)

    INSERT [Common].[t_TblMaint_Tables] ([Tbl_id], [TableName], [TableComment], [DatabaseName], [SchemaName], [TableIDField], [IsActive]) VALUES (25, N't_Facility_Group', N'Facility: definition of groups', N'Vision', N'Common', N'GroupID', 1)

    INSERT [Common].[t_TblMaint_Tables] ([Tbl_id], [TableName], [TableComment], [DatabaseName], [SchemaName], [TableIDField], [IsActive]) VALUES (29, N't_Facility_Performance_Category', N'Facility: Performance Category', N'Vision', N'Common', N'PerfCatID', 1)

    INSERT [Common].[t_TblMaint_Tables] ([Tbl_id], [TableName], [TableComment], [DatabaseName], [SchemaName], [TableIDField], [IsActive]) VALUES (30, N't_Facility_Performance_Score', N'Facility: Performance Score', N'Vision', N'Common', N'ItemID', 1)

    INSERT [Common].[t_TblMaint_Tables] ([Tbl_id], [TableName], [TableComment], [DatabaseName], [SchemaName], [TableIDField], [IsActive]) VALUES (26, N't_Facility_Region', N'Facility: definition of regions', N'Vision', N'Common', N'RegionID', 1)

    INSERT [Common].[t_TblMaint_Tables] ([Tbl_id], [TableName], [TableComment], [DatabaseName], [SchemaName], [TableIDField], [IsActive]) VALUES (28, N't_FacilitySurgical_CodeXref', N'Facility: code mapping for Surgical facilities', N'Vision', N'dbo', N'ID', 1)

    INSERT [Common].[t_TblMaint_Tables] ([Tbl_id], [TableName], [TableComment], [DatabaseName], [SchemaName], [TableIDField], [IsActive]) VALUES (22, N't_holiday', N'Holiday List', N'Vision', N'Common', N'HolidayID', 1)

    INSERT [Common].[t_TblMaint_Tables] ([Tbl_id], [TableName], [TableComment], [DatabaseName], [SchemaName], [TableIDField], [IsActive]) VALUES (32, N't_Procedure', N'Procedure: Procedure Codes related to Report type', N'Vision', N'Common', N'ProcedureID', 0)

    INSERT [Common].[t_TblMaint_Tables] ([Tbl_id], [TableName], [TableComment], [DatabaseName], [SchemaName], [TableIDField], [IsActive]) VALUES (37, N't_Productivity_ClockID_Xref', N'Clock IDs:Clock IDs to Facilitie ', N'Vision', N'[External]', N'ID', 1)

    INSERT [Common].[t_TblMaint_Tables] ([Tbl_id], [TableName], [TableComment], [DatabaseName], [SchemaName], [TableIDField], [IsActive]) VALUES (12, N't_Security_Role', N'Security: Define Roles', N'Vision', N'Common', N'RoleID', 0)

    INSERT [Common].[t_TblMaint_Tables] ([Tbl_id], [TableName], [TableComment], [DatabaseName], [SchemaName], [TableIDField], [IsActive]) VALUES (13, N't_Security_RolePermission', N'Security: Define which Permissions each Role has', N'Vision', N'Common', N'ItemID', 0)

    INSERT [Common].[t_TblMaint_Tables] ([Tbl_id], [TableName], [TableComment], [DatabaseName], [SchemaName], [TableIDField], [IsActive]) VALUES (14, N't_Security_User', N'Security: Define Users that have access to this system', N'Vision', N'Common', N'UserID', 1)

    INSERT [Common].[t_TblMaint_Tables] ([Tbl_id], [TableName], [TableComment], [DatabaseName], [SchemaName], [TableIDField], [IsActive]) VALUES (15, N't_Security_UserRole', N'Security: Define which Roles the Users belong to', N'Vision', N'Common', N'ItemID', 0)

    INSERT [Common].[t_TblMaint_Tables] ([Tbl_id], [TableName], [TableComment], [DatabaseName], [SchemaName], [TableIDField], [IsActive]) VALUES (27, N't_Team', N'Team: definition of specialty teams', N'Vision', N'Common', N'TeamID', 1)

    INSERT [Common].[t_TblMaint_Tables] ([Tbl_id], [TableName], [TableComment], [DatabaseName], [SchemaName], [TableIDField], [IsActive]) VALUES (23, N't_VisitType', N'Visit Types', N'Vision', N'Common', N'VisitTypeID', 1)

    INSERT [Common].[t_TblMaint_Tables] ([Tbl_id], [TableName], [TableComment], [DatabaseName], [SchemaName], [TableIDField], [IsActive]) VALUES (47, N't_Department', N'Department: Department List', N'Vision', N'Common', N'DeptID', 1)

    INSERT [Common].[t_TblMaint_Tables] ([Tbl_id], [TableName], [TableComment], [DatabaseName], [SchemaName], [TableIDField], [IsActive]) VALUES (48, N't_Employee_JobTitle', N'Job Titles:Job Titles to Department ', N'Vision', N'Common', N'JobTitleID', 1)

    INSERT [Common].[t_TblMaint_Tables] ([Tbl_id], [TableName], [TableComment], [DatabaseName], [SchemaName], [TableIDField], [IsActive]) VALUES (49, N't_Productivity_ClockID_Xref', N'Clock IDs:Clock IDs to Facilitie ', N'Vision', N'[External]', N'ID', 1)

    INSERT [Common].[t_TblMaint_Tables] ([Tbl_id], [TableName], [TableComment], [DatabaseName], [SchemaName], [TableIDField], [IsActive]) VALUES (50, N't_Department', N'Department: Department List', N'Vision', N'Common', N'DeptID', 1)

    INSERT [Common].[t_TblMaint_Tables] ([Tbl_id], [TableName], [TableComment], [DatabaseName], [SchemaName], [TableIDField], [IsActive]) VALUES (51, N't_Employee_JobTitle', N'Job Titles:Job Titles to Department ', N'Vision', N'Common', N'JobTitleID', 1)

    INSERT [Common].[t_TblMaint_Tables] ([Tbl_id], [TableName], [TableComment], [DatabaseName], [SchemaName], [TableIDField], [IsActive]) VALUES (52, N't_Productivity_ClockID_Xref', N'Clock IDs:Clock IDs to Facilitie ', N'Vision', N'[External]', N'ID', 1)

    SET IDENTITY_INSERT [Common].[t_TblMaint_Tables] OFF

    /****** Object: Table [Common].[t_TblMaint_Col_DropDownData] Script Date: 06/07/2013 12:37:14 ******/

    SET IDENTITY_INSERT [Common].[t_TblMaint_Col_DropDownData] ON

    INSERT [Common].[t_TblMaint_Col_DropDownData] ([DDD_ID], [CCOM_ID], [LookupTableName], [IDFieldName], [ValueFieldName], [RequiresEmptyValue]) VALUES (13, 102, N'Common.t_Team', N'TeamID', N'TeamName ', N'0')

    INSERT [Common].[t_TblMaint_Col_DropDownData] ([DDD_ID], [CCOM_ID], [LookupTableName], [IDFieldName], [ValueFieldName], [RequiresEmptyValue]) VALUES (16, 137, N'Common.t_Facility_Group', N'GroupID', N'GroupDescr', N'0')

    INSERT [Common].[t_TblMaint_Col_DropDownData] ([DDD_ID], [CCOM_ID], [LookupTableName], [IDFieldName], [ValueFieldName], [RequiresEmptyValue]) VALUES (15, 145, N'Common.t_Facility', N'FacilityID', N'FacilityName ', N'0')

    INSERT [Common].[t_TblMaint_Col_DropDownData] ([DDD_ID], [CCOM_ID], [LookupTableName], [IDFieldName], [ValueFieldName], [RequiresEmptyValue]) VALUES (17, 126, N'Common.t_Doctor_Role', N'RoleID', N'RoleDescr', N'0')

    INSERT [Common].[t_TblMaint_Col_DropDownData] ([DDD_ID], [CCOM_ID], [LookupTableName], [IDFieldName], [ValueFieldName], [RequiresEmptyValue]) VALUES (18, 155, N'Common.t_Doctor', N'DoctorID', N'DoctorCode', N'0')

    INSERT [Common].[t_TblMaint_Col_DropDownData] ([DDD_ID], [CCOM_ID], [LookupTableName], [IDFieldName], [ValueFieldName], [RequiresEmptyValue]) VALUES (23, 223, N'Common.t_Facility_Type', N'FacTypeID', N'FacTypeDescr', N'0')

    INSERT [Common].[t_TblMaint_Col_DropDownData] ([DDD_ID], [CCOM_ID], [LookupTableName], [IDFieldName], [ValueFieldName], [RequiresEmptyValue]) VALUES (24, 225, N'Common.t_Facility', N'FacilityID', N'FacilityName', N'0')

    INSERT [Common].[t_TblMaint_Col_DropDownData] ([DDD_ID], [CCOM_ID], [LookupTableName], [IDFieldName], [ValueFieldName], [RequiresEmptyValue]) VALUES (25, 250, N'Common.t_Doctor', N'DoctorID', N'DoctorCode', N'0')

    INSERT [Common].[t_TblMaint_Col_DropDownData] ([DDD_ID], [CCOM_ID], [LookupTableName], [IDFieldName], [ValueFieldName], [RequiresEmptyValue]) VALUES (9, 77, N'Common.t_Security_Role', N'RoleID', N'RoleName', N'0')

    INSERT [Common].[t_TblMaint_Col_DropDownData] ([DDD_ID], [CCOM_ID], [LookupTableName], [IDFieldName], [ValueFieldName], [RequiresEmptyValue]) VALUES (10, 78, N'Common.t_Security_Permission', N'PermissionID', N'Description', N'0')

    INSERT [Common].[t_TblMaint_Col_DropDownData] ([DDD_ID], [CCOM_ID], [LookupTableName], [IDFieldName], [ValueFieldName], [RequiresEmptyValue]) VALUES (26, 256, N'Common.t_VisitType', N'VisitTypeID', N'VisitTypeCode', N'0')

    INSERT [Common].[t_TblMaint_Col_DropDownData] ([DDD_ID], [CCOM_ID], [LookupTableName], [IDFieldName], [ValueFieldName], [RequiresEmptyValue]) VALUES (27, 257, N'Common.t_FinancialProcType', N'FinancialProcTypeID', N'TypeCode', N'0')

    INSERT [Common].[t_TblMaint_Col_DropDownData] ([DDD_ID], [CCOM_ID], [LookupTableName], [IDFieldName], [ValueFieldName], [RequiresEmptyValue]) VALUES (28, 258, N'Common.t_HighVolumeProcType', N'HighVolumeTypeID', N'TypeCode', N'0')

    INSERT [Common].[t_TblMaint_Col_DropDownData] ([DDD_ID], [CCOM_ID], [LookupTableName], [IDFieldName], [ValueFieldName], [RequiresEmptyValue]) VALUES (29, 259, N'Common.t_Surgery_Type', N'SurgTypeID', N'SurgTypeCode', N'0')

    INSERT [Common].[t_TblMaint_Col_DropDownData] ([DDD_ID], [CCOM_ID], [LookupTableName], [IDFieldName], [ValueFieldName], [RequiresEmptyValue]) VALUES (30, 240, N'Common.t_Facility_Performance_Category', N'PerfCatID', N'PerfCatDescr', NULL)

    INSERT [Common].[t_TblMaint_Col_DropDownData] ([DDD_ID], [CCOM_ID], [LookupTableName], [IDFieldName], [ValueFieldName], [RequiresEmptyValue]) VALUES (31, 269, N'Common.t_Doctor', N'DoctorID', N'DoctorCode', N'0')

    INSERT [Common].[t_TblMaint_Col_DropDownData] ([DDD_ID], [CCOM_ID], [LookupTableName], [IDFieldName], [ValueFieldName], [RequiresEmptyValue]) VALUES (32, 270, N'Common.t_Team', N'TeamID', N'TeamName ', N'0')

    INSERT [Common].[t_TblMaint_Col_DropDownData] ([DDD_ID], [CCOM_ID], [LookupTableName], [IDFieldName], [ValueFieldName], [RequiresEmptyValue]) VALUES (33, 279, N'Common.t_Department', N'DeptID', N'DeptDescription', N'0')

    INSERT [Common].[t_TblMaint_Col_DropDownData] ([DDD_ID], [CCOM_ID], [LookupTableName], [IDFieldName], [ValueFieldName], [RequiresEmptyValue]) VALUES (34, 297, N'Common.t_Facility', N'FacilityID', N'FacilityName', N'0')

    INSERT [Common].[t_TblMaint_Col_DropDownData] ([DDD_ID], [CCOM_ID], [LookupTableName], [IDFieldName], [ValueFieldName], [RequiresEmptyValue]) VALUES (35, 288, N'Common.t_Department', N'DeptID', N'DeptDescription', N'0')

    INSERT [Common].[t_TblMaint_Col_DropDownData] ([DDD_ID], [CCOM_ID], [LookupTableName], [IDFieldName], [ValueFieldName], [RequiresEmptyValue]) VALUES (36, 289, N'Common.t_Facility', N'FacilityID', N'FacilityName', N'0')

    INSERT [Common].[t_TblMaint_Col_DropDownData] ([DDD_ID], [CCOM_ID], [LookupTableName], [IDFieldName], [ValueFieldName], [RequiresEmptyValue]) VALUES (37, 279, N'Common.t_Department', N'DeptID', N'DeptDescription', N'0')

    INSERT [Common].[t_TblMaint_Col_DropDownData] ([DDD_ID], [CCOM_ID], [LookupTableName], [IDFieldName], [ValueFieldName], [RequiresEmptyValue]) VALUES (38, 288, N'Common.t_Department', N'DeptID', N'DeptDescription', N'0')

    INSERT [Common].[t_TblMaint_Col_DropDownData] ([DDD_ID], [CCOM_ID], [LookupTableName], [IDFieldName], [ValueFieldName], [RequiresEmptyValue]) VALUES (39, 289, N'Common.t_Facility', N'FacilityID', N'FacilityName', N'0')

    INSERT [Common].[t_TblMaint_Col_DropDownData] ([DDD_ID], [CCOM_ID], [LookupTableName], [IDFieldName], [ValueFieldName], [RequiresEmptyValue]) VALUES (40, 297, N'Common.t_Facility', N'FacilityID', N'FacilityName', N'0')

    INSERT [Common].[t_TblMaint_Col_DropDownData] ([DDD_ID], [CCOM_ID], [LookupTableName], [IDFieldName], [ValueFieldName], [RequiresEmptyValue]) VALUES (41, 279, N'Common.t_Department', N'DeptID', N'DeptDescription', N'0')

    INSERT [Common].[t_TblMaint_Col_DropDownData] ([DDD_ID], [CCOM_ID], [LookupTableName], [IDFieldName], [ValueFieldName], [RequiresEmptyValue]) VALUES (42, 288, N'Common.t_Department', N'DeptID', N'DeptDescription', N'0')

    INSERT [Common].[t_TblMaint_Col_DropDownData] ([DDD_ID], [CCOM_ID], [LookupTableName], [IDFieldName], [ValueFieldName], [RequiresEmptyValue]) VALUES (11, 91, N'Common.t_Security_Role', N'RoleID', N'RoleName', N'0')

    INSERT [Common].[t_TblMaint_Col_DropDownData] ([DDD_ID], [CCOM_ID], [LookupTableName], [IDFieldName], [ValueFieldName], [RequiresEmptyValue]) VALUES (12, 92, N'Common.t_Security_User', N'UserID', N'UserLogin', N'0')

    INSERT [Common].[t_TblMaint_Col_DropDownData] ([DDD_ID], [CCOM_ID], [LookupTableName], [IDFieldName], [ValueFieldName], [RequiresEmptyValue]) VALUES (19, 168, N'Common.t_Doctor', N'DoctorID', N'DoctorCode', N'0')

    INSERT [Common].[t_TblMaint_Col_DropDownData] ([DDD_ID], [CCOM_ID], [LookupTableName], [IDFieldName], [ValueFieldName], [RequiresEmptyValue]) VALUES (20, 198, N'Common.t_Facility', N'FacilityID', N'FacilityName', N'0')

    INSERT [Common].[t_TblMaint_Col_DropDownData] ([DDD_ID], [CCOM_ID], [LookupTableName], [IDFieldName], [ValueFieldName], [RequiresEmptyValue]) VALUES (21, 214, N'Common.t_Facility_Region', N'RegionID', N'RegionName', N'0')

    INSERT [Common].[t_TblMaint_Col_DropDownData] ([DDD_ID], [CCOM_ID], [LookupTableName], [IDFieldName], [ValueFieldName], [RequiresEmptyValue]) VALUES (22, 171, N'Common.t_Budget_Type', N'BudgetTypeID', N'BudgetTypeDescr', N'0')

    INSERT [Common].[t_TblMaint_Col_DropDownData] ([DDD_ID], [CCOM_ID], [LookupTableName], [IDFieldName], [ValueFieldName], [RequiresEmptyValue]) VALUES (43, 289, N'Common.t_Facility', N'FacilityID', N'FacilityName', N'0')

    INSERT [Common].[t_TblMaint_Col_DropDownData] ([DDD_ID], [CCOM_ID], [LookupTableName], [IDFieldName], [ValueFieldName], [RequiresEmptyValue]) VALUES (44, 297, N'Common.t_Facility', N'FacilityID', N'FacilityName', N'0')

    INSERT [Common].[t_TblMaint_Col_DropDownData] ([DDD_ID], [CCOM_ID], [LookupTableName], [IDFieldName], [ValueFieldName], [RequiresEmptyValue]) VALUES (45, 279, N'Common.t_Department', N'DeptID', N'DeptDescription', N'0')

    INSERT [Common].[t_TblMaint_Col_DropDownData] ([DDD_ID], [CCOM_ID], [LookupTableName], [IDFieldName], [ValueFieldName], [RequiresEmptyValue]) VALUES (46, 288, N'Common.t_Department', N'DeptID', N'DeptDescription', N'0')

    INSERT [Common].[t_TblMaint_Col_DropDownData] ([DDD_ID], [CCOM_ID], [LookupTableName], [IDFieldName], [ValueFieldName], [RequiresEmptyValue]) VALUES (47, 289, N'Common.t_Facility', N'FacilityID', N'FacilityName', N'0')

    INSERT [Common].[t_TblMaint_Col_DropDownData] ([DDD_ID], [CCOM_ID], [LookupTableName], [IDFieldName], [ValueFieldName], [RequiresEmptyValue]) VALUES (48, 297, N'Common.t_Facility', N'FacilityID', N'FacilityName', N'0')

    INSERT [Common].[t_TblMaint_Col_DropDownData] ([DDD_ID], [CCOM_ID], [LookupTableName], [IDFieldName], [ValueFieldName], [RequiresEmptyValue]) VALUES (49, 279, N'Common.t_Department', N'DeptID', N'DeptDescription', N'0')

    INSERT [Common].[t_TblMaint_Col_DropDownData] ([DDD_ID], [CCOM_ID], [LookupTableName], [IDFieldName], [ValueFieldName], [RequiresEmptyValue]) VALUES (50, 288, N'Common.t_Department', N'DeptID', N'DeptDescription', N'0')

    INSERT [Common].[t_TblMaint_Col_DropDownData] ([DDD_ID], [CCOM_ID], [LookupTableName], [IDFieldName], [ValueFieldName], [RequiresEmptyValue]) VALUES (51, 289, N'Common.t_Facility', N'FacilityID', N'FacilityName', N'0')

    INSERT [Common].[t_TblMaint_Col_DropDownData] ([DDD_ID], [CCOM_ID], [LookupTableName], [IDFieldName], [ValueFieldName], [RequiresEmptyValue]) VALUES (52, 297, N'Common.t_Facility', N'FacilityID', N'FacilityName', N'0')

    INSERT [Common].[t_TblMaint_Col_DropDownData] ([DDD_ID], [CCOM_ID], [LookupTableName], [IDFieldName], [ValueFieldName], [RequiresEmptyValue]) VALUES (53, 279, N'Common.t_Department', N'DeptID', N'DeptDescription', N'0')

    INSERT [Common].[t_TblMaint_Col_DropDownData] ([DDD_ID], [CCOM_ID], [LookupTableName], [IDFieldName], [ValueFieldName], [RequiresEmptyValue]) VALUES (54, 288, N'Common.t_Department', N'DeptID', N'DeptDescription', N'0')

    INSERT [Common].[t_TblMaint_Col_DropDownData] ([DDD_ID], [CCOM_ID], [LookupTableName], [IDFieldName], [ValueFieldName], [RequiresEmptyValue]) VALUES (55, 289, N'Common.t_Facility', N'FacilityID', N'FacilityName', N'0')

    INSERT [Common].[t_TblMaint_Col_DropDownData] ([DDD_ID], [CCOM_ID], [LookupTableName], [IDFieldName], [ValueFieldName], [RequiresEmptyValue]) VALUES (56, 297, N'Common.t_Facility', N'FacilityID', N'FacilityName', N'0')

    SET IDENTITY_INSERT [Common].[t_TblMaint_Col_DropDownData] OFF

    /****** Object: Table [Common].[t_TblMaint_Col_Comments] Script Date: 06/07/2013 12:37:14 ******/

    SET IDENTITY_INSERT [Common].[t_TblMaint_Col_Comments] ON

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (197, N'FacilityCodeXref', N'DateAdded', N'Enter Date Added', N'TextBox', N'DateAdded')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (195, N'FacilityCodeXref', N'FacilityCode', N'Enter Facility Code', N'TextBox', N'FacilityCode')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (198, N'FacilityCodeXref', N'FacilityID', N'Enter Facility ID', N'DropDown', N'FacilityID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (199, N'FacilityCodeXref', N'ID', N'ID', N'Label', N'UniqueID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (196, N'FacilityCodeXref', N'UseForEpis', N'Enter Use For Epis', N'TextBox', N'UseForEpis')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (171, N't_Budget', N'BudgetTypeID', N'Enter Budget Type ID', N'DropDown', N'BudgetTypeID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (168, N't_Budget', N'DoctorID', N'Enter Doctor ID', N'DropDown', N'DoctorID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (169, N't_Budget', N'EffectiveDate', N'Enter Effective Date', N'TextBox', N'EffectiveDate')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (167, N't_Budget', N'ItemID', N'Item ID', N'Label', N'UniqueID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (176, N't_Budget', N'ModifiedBy', N'Modified By', N'Label', N'ModifiedBy')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (175, N't_Budget', N'ModifiedDateTime', N'Modified Date Time', N'Label', N'ModifiedDateTime')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (172, N't_Budget', N'MonthlyBudget', N'Enter Monthly Budget', N'TextBox', N'MonthlyBudget')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (260, N't_CallCenter_VisionLogin', N'ItemID', N'Item ID', N'Label', N'UniqueID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (266, N't_CallCenter_VisionLogin', N'ModifiedBy', N'Modified By', N'Label', N'ModifiedBy')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (265, N't_CallCenter_VisionLogin', N'ModifiedDateTime', N'Modified Date Time', N'Label', N'ModifiedDateTime')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (261, N't_CallCenter_VisionLogin', N'UserName', N'Enter User Name', N'TextBox', N'UserName')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (262, N't_CallCenter_VisionLogin', N'VisionLogin', N'Enter Vision Login', N'TextBox', N'VisionLogin')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (280, N't_Department', N'DeptCode', N'Enter Dept Code', N'TextBox', N'DeptCode')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (281, N't_Department', N'DeptDescription', N'Enter Dept Description', N'TextBox', N'DeptDescription')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (279, N't_Department', N'DeptID', N'Dept ID', N'Label', N'UniqueID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (164, N't_Doctor', N'Doctor_EndDate', N'Enter Doctor End Date', N'TextBox', N'DoctorEndDate')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (163, N't_Doctor', N'Doctor_StartDate', N'Enter Doctor Start Date', N'TextBox', N'DoctorStartDate')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (98, N't_Doctor', N'DoctorCode', N'Enter Doctor Code', N'TextBox', N'DoctorCode')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (97, N't_Doctor', N'DoctorID', N'Doctor ID', N'Label', N'UniqueID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (126, N't_Doctor', N'DoctorRoleID', N'Enter Doctor Role ID', N'DropDown', N'DoctorRoleID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (99, N't_Doctor', N'FirstName', N'Enter First Name', N'TextBox', N'FirstName')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (100, N't_Doctor', N'LastName', N'Enter Last Name', N'TextBox', N'LastName')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (101, N't_Doctor', N'MiddleName', N'Enter Middle Name', N'TextBox', N'MiddleName')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (125, N't_Doctor', N'SortByDrno', N'Enter Sort By Drno', N'TextBox', N'SortByDRNO')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (155, N't_Doctor_FTE', N'DoctorID', N'Enter Doctor ID', N'DropDown', N'DoctorID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (156, N't_Doctor_FTE', N'EffectiveDate', N'Enter Effective Date', N'TextBox', N'EffectiveDate')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (157, N't_Doctor_FTE', N'FTE', N'Enter F T E', N'TextBox', N'FTE')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (154, N't_Doctor_FTE', N'ItemID', N'Item ID', N'Label', N'UniqueID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (161, N't_Doctor_FTE', N'ModifiedBy', N'Modified By', N'Label', N'ModifiedBy')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (160, N't_Doctor_FTE', N'ModifiedDatetime', N'Modified Datetime', N'Label', N'ModifiedDateTime')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (132, N't_Doctor_Role', N'ModifiedBy', N'Modified By', N'Label', N'ModifiedBy')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (131, N't_Doctor_Role', N'ModifiedDateTime', N'Modified Date Time', N'Label', N'ModifiedDateTime')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (128, N't_Doctor_Role', N'RoleDescr', N'Enter Role Descr', N'TextBox', N'RoleDescription')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (127, N't_Doctor_Role', N'RoleID', N'Role ID', N'Label', N'UniqueID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (249, N't_Doctor_Split', N'DocSplitID', N'Item ID', N'Label', N'UniqueID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (250, N't_Doctor_Split', N'DoctorID', N'Select Doctor Code', N'DropDown', N'UniqueID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (251, N't_Doctor_Split', N'EffectiveDate', N'Enter Effective Date', N'TextBox', N'EffectiveDate')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (252, N't_Doctor_Split', N'EndDate', N'Enter End Date (use 12/31/9999 if permanent)', N'TextBox', N'EndDate')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (269, N't_Doctor_Team', N'DoctorID', N'Enter Doctor ID', N'DropDown', N'DoctorID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (271, N't_Doctor_Team', N'EffectiveDate', N'Enter Effective Date', N'TextBox', N'EffectiveDate')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (268, N't_Doctor_Team', N'ItemID', N'Item ID', N'Label', N'UniqueID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (275, N't_Doctor_Team', N'ModifiedBy', N'Modified By', N'Label', N'ModifiedBy')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (274, N't_Doctor_Team', N'ModifiedDateTime', N'Modified Date Time', N'Label', N'ModifiedDateTime')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (270, N't_Doctor_Team', N'TeamID', N'Enter Team ID', N'DropDown', N'TeamID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (289, N't_Employee_JobTitle', N'DefaultFacilityID', N'Enter Default Facility ID', N'DropDown', N'DefaultFacilityID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (288, N't_Employee_JobTitle', N'DeptID', N'Enter Dept ID', N'DropDown', N'DeptID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (290, N't_Employee_JobTitle', N'EffectiveDate', N'Enter Effective Date', N'TextBox', N'EffectiveDate')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (287, N't_Employee_JobTitle', N'JobTitle', N'Enter Job Title', N'TextBox', N'JobTitle')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (286, N't_Employee_JobTitle', N'JobTitleID', N'Job Title ID', N'Label', N'UniqueID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (137, N't_Facility', N'FacilityGroupID', N'Enter Facility Group ID', N'DropDown', N'FacilityGroupID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (134, N't_Facility', N'FacilityID', N'Facility ID', N'Label', N'UniqueID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (136, N't_Facility', N'FacilityName', N'Enter Facility Name', N'TextBox', N'FacilityName')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (223, N't_Facility', N'FacilityTypeID', N'Select Facility Type', N'DropDown', N'FacilityTypeID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (142, N't_Facility', N'ModifiedBy', N'Modified By', N'Label', N'ModifiedBy')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (141, N't_Facility', N'ModifiedDateTime', N'Modified Date Time', N'Label', N'ModifiedDateTime')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (214, N't_Facility', N'RegionID', N'Enter Region ID', N'DropDown', N'RegionID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (147, N't_Facility_ExamRoom', N'EffectiveDate_Start', N'Enter Effective Date_ Start', N'TextBox', N'EffectiveDate_Start')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (146, N't_Facility_ExamRoom', N'ExamRooms', N'Enter Exam Rooms', N'TextBox', N'ExamRooms')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (145, N't_Facility_ExamRoom', N'FacilityID', N'Enter Facility ID', N'DropDown', N'FacilityID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (152, N't_Facility_ExamRoom', N'ModifiedBy', N'Modified By', N'Label', N'ModifiedBy')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (151, N't_Facility_ExamRoom', N'ModifiedDateTime', N'Modified Date Time', N'Label', N'ModifiedDateTime')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (144, N't_Facility_ExamRoom', N'RecordID', N'Record ID', N'Label', N'UniqueID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (201, N't_Facility_Group', N'GroupDescr', N'Enter Group Descr', N'TextBox', N'GroupDescr')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (200, N't_Facility_Group', N'GroupID', N'Group ID', N'Label', N'UniqueID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (205, N't_Facility_Group', N'ModifiedBy', N'Modified By', N'Label', N'ModifiedBy')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (204, N't_Facility_Group', N'ModifiedDateTime', N'Modified Date Time', N'Label', N'ModifiedDateTime')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (232, N't_Facility_Performance_Category', N'IsActive', N'Enter Is Active', N'TextBox', N'IsActive')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (237, N't_Facility_Performance_Category', N'ModifiedBy', N'Modified By', N'Label', N'ModifiedBy')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (236, N't_Facility_Performance_Category', N'ModifiedDateTime', N'Modified Date Time', N'Label', N'ModifiedDateTime')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (229, N't_Facility_Performance_Category', N'PerfCatCode', N'Enter Perf Cat Code', N'TextBox', N'PerfCatCode')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (230, N't_Facility_Performance_Category', N'PerfCatDescr', N'Enter Perf Cat Descr', N'TextBox', N'PerfCatDescr')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (228, N't_Facility_Performance_Category', N'PerfCatID', N'Perf Cat ID', N'Label', N'UniqueID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (278, N't_Facility_Performance_Category', N'Prefix', N'Prefix', N'TextBox', N'Prefix')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (277, N't_Facility_Performance_Category', N'Suffix', N'Suffix', N'TextBox', N'Suffix')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (231, N't_Facility_Performance_Category', N'Weight', N'Enter Weight', N'TextBox', N'Weight')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (241, N't_Facility_Performance_Score', N'GreaterThan', N'Enter Greater Than', N'TextBox', N'GreaterThan')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (239, N't_Facility_Performance_Score', N'ItemID', N'Item ID', N'Label', N'UniqueID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (242, N't_Facility_Performance_Score', N'LessOrEqualTo', N'Enter Less Or Equal To', N'TextBox', N'LessOrEqualTo')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (247, N't_Facility_Performance_Score', N'ModifiedBy', N'Modified By', N'Label', N'ModifiedBy')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (246, N't_Facility_Performance_Score', N'ModifiedDateTime', N'Modified Date Time', N'Label', N'ModifiedDateTime')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (240, N't_Facility_Performance_Score', N'PerfCatID', N'Enter Perf Cat ID', N'DropDown', N'PerformanceCategoryID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (243, N't_Facility_Performance_Score', N'Points', N'Enter Points', N'TextBox', N'Points')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (359, N't_Department', N'DeptID', N'Dept ID', N'Label', N'UniqueID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (360, N't_Department', N'DeptCode', N'Enter Dept Code', N'TextBox', N'DeptCode')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (361, N't_Department', N'DeptDescription', N'Enter Dept Description', N'TextBox', N'DeptDescription')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (366, N't_Employee_JobTitle', N'JobTitleID', N'Job Title ID', N'Label', N'UniqueID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (367, N't_Employee_JobTitle', N'JobTitle', N'Enter Job Title', N'TextBox', N'JobTitle')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (212, N't_Facility_Region', N'Modifiedby', N'Modifiedby', N'Label', N'ModifiedBy')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (211, N't_Facility_Region', N'ModifiedDateTime', N'Modified Date Time', N'Label', N'ModifiedDateTime')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (207, N't_Facility_Region', N'RegionID', N'Region ID', N'Label', N'UniqueID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (208, N't_Facility_Region', N'RegionName', N'Enter Region Name', N'TextBox', N'RegionName')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (224, N't_FacilitySurgical_CodeXref', N'FacilityCode', N'Enter Facility Code', N'TextBox', N'FacilityCode')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (225, N't_FacilitySurgical_CodeXref', N'FacilityID', N'Select Facility', N'DropDown', N'FacilityID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (227, N't_FacilitySurgical_CodeXref', N'ID', N'ID', N'Label', N'UniqueID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (180, N't_holiday', N'Description', N'Enter Description', N'TextBox', N'Description')

    GO

    print 'Processed 100 total records'

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (179, N't_holiday', N'HolidayDate', N'Enter Holiday Date', N'TextBox', N'HolidayDate')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (178, N't_holiday', N'HolidayID', N'Holiday ID', N'Label', N'UniqueID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (184, N't_holiday', N'ModifiedBy', N'Modified By', N'Label', N'ModifiedBy')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (183, N't_holiday', N'ModifiedDateTime', N'Modified Date Time', N'Label', N'ModifiedDateTime')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (257, N't_Procedure', N'FinancialProcTypeID', N'Financials Procedure Type', N'DropDown', N'FinancialProcedureTypeID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (258, N't_Procedure', N'HighVolumeTypeID', N'High Volume Procedure Type', N'DropDown', N'HighVolumeTypeID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (254, N't_Procedure', N'ProcedureCode', N'Enter Procedure Code', N'TextBox', N'ProcedureCode')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (255, N't_Procedure', N'ProcedureDescr', N'Enter Procedure Description', N'TextBox', N'ProcedureDescription')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (253, N't_Procedure', N'ProcedureID', N'Item ID', N'Label', N'UniqueID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (259, N't_Procedure', N'SurgicalTypeID', N'Surgical Procedure Type', N'DropDown', N'SurgicalTypeID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (256, N't_Procedure', N'VisitTypeID', N'Visit Volume Procedure Type', N'DropDown', N'VisitTypeID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (298, N't_Productivity_ClockID_Xref', N'EffectiveDate', N'Enter Effective Date', N'TextBox', N'EffectiveDate')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (296, N't_Productivity_ClockID_Xref', N'EmpFacilityClockID', N'Enter Emp Facility Clock ID', N'TextBox', N'EmpFacilityClockID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (297, N't_Productivity_ClockID_Xref', N'FacilityID', N'Enter Facility ID', N'DropDown', N'FacilityID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (295, N't_Productivity_ClockID_Xref', N'ID', N'ID', N'Label', N'UniqueID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (75, N't_Security_Role', N'ModifiedBy', N'Modified By', N'Label', N'ModifiedBy')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (74, N't_Security_Role', N'ModifiedDateTime', N'Modified Date Time', N'Label', N'ModifiedDateTime')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (71, N't_Security_Role', N'RoleDescription', N'Enter Role Description', N'TextBox', N'RoleDescription')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (69, N't_Security_Role', N'RoleID', N'Role ID', N'Label', N'UniqueID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (70, N't_Security_Role', N'RoleName', N'Enter Role Name', N'TextBox', N'RoleName')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (76, N't_Security_RolePermission', N'ItemID', N'Item ID', N'Label', N'UniqueID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (82, N't_Security_RolePermission', N'ModifiedBy', N'Modified By', N'Label', N'ModifiedBy')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (81, N't_Security_RolePermission', N'ModifiedDateTime', N'Modified Date Time', N'Label', N'ModifiedDateTime')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (78, N't_Security_RolePermission', N'PermissionID', N'Enter Permission ID', N'DropDown', N'PermissionID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (77, N't_Security_RolePermission', N'RoleID', N'Enter Role ID', N'DropDown', N'RoleID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (89, N't_Security_User', N'ModifiedBy', N'Modified By', N'Label', N'ModifiedBy')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (88, N't_Security_User', N'ModifiedDateTime', N'Modified Date Time', N'Label', N'ModifiedDateTime')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (83, N't_Security_User', N'UserID', N'User ID', N'Label', N'UniqueID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (84, N't_Security_User', N'UserLogin', N'Enter User Login', N'TextBox', N'UserLogin')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (85, N't_Security_User', N'UserName', N'Enter User Name', N'TextBox', N'UserName')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (90, N't_Security_UserRole', N'ItemID', N'Item ID', N'Label', N'UniqueID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (96, N't_Security_UserRole', N'ModifiedBy', N'Modified By', N'Label', N'ModifiedBy')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (95, N't_Security_UserRole', N'ModifiedDateTime', N'Modified Date Time', N'Label', N'ModifiedDateTime')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (91, N't_Security_UserRole', N'RoleID', N'Enter Role ID', N'DropDown', N'RoleID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (92, N't_Security_UserRole', N'UserID', N'Enter User ID', N'DropDown', N'UserID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (221, N't_Team', N'ModifiedBy', N'Modified By', N'Label', N'ModifiedBy')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (220, N't_Team', N'ModifiedDateTime', N'Modified Date Time', N'Label', N'ModifiedDateTime')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (217, N't_Team', N'PerformsSurgery', N'Enter Performs Surgery', N'TextBox', N'PerformsSurgery')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (222, N't_Team', N'SortByTeamID', N'Enter Sort By Team ID', N'TextBox', N'SortByTeamID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (215, N't_Team', N'TeamID', N'Team ID', N'Label', N'UniqueID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (216, N't_Team', N'TeamName', N'Enter Team Name', N'TextBox', N'TeamName')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (191, N't_VisitType', N'ModifiedBy', N'Modified By', N'Label', N'ModifiedBy')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (190, N't_VisitType', N'ModifiedDateTime', N'Modified Date Time', N'Label', N'ModifiedDateTime')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (194, N't_VisitType', N'NewIndicator', N'Enter New Indicator', N'TextBox', N'NewIndicator')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (186, N't_VisitType', N'VisitTypeCode', N'Enter Visit Type Code', N'TextBox', N'VisitTypeCode')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (187, N't_VisitType', N'VisitTypeDescr', N'Enter Visit Type Descr', N'TextBox', N'VisitTypeDescription')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (193, N't_VisitType', N'VisitTypeGroupID', N'Enter Visit Type Group ID', N'TextBox', N'VisitTypeGroupID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (185, N't_VisitType', N'VisitTypeID', N'Visit Type ID', N'Label', N'UniqueID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (368, N't_Employee_JobTitle', N'DeptID', N'Enter Dept ID', N'DropDown', N'DeptID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (369, N't_Employee_JobTitle', N'DefaultFacilityID', N'Enter Default Facility ID', N'DropDown', N'DefaultFacilityID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (370, N't_Employee_JobTitle', N'EffectiveDate', N'Enter Effective Date', N'TextBox', N'EffectiveDate')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (375, N't_Productivity_ClockID_Xref', N'ID', N'ID', N'Label', N'UniqueID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (376, N't_Productivity_ClockID_Xref', N'EmpFacilityClockID', N'Enter Emp Facility Clock ID', N'TextBox', N'EmpFacilityClockID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (377, N't_Productivity_ClockID_Xref', N'FacilityID', N'Enter Facility ID', N'DropDown', N'FacilityID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (378, N't_Productivity_ClockID_Xref', N'EffectiveDate', N'Enter Effective Date', N'TextBox', N'EffectiveDate')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (379, N't_Department', N'DeptID', N'Dept ID', N'Label', N'UniqueID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (380, N't_Department', N'DeptCode', N'Enter Dept Code', N'TextBox', N'DeptCode')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (381, N't_Department', N'DeptDescription', N'Enter Dept Description', N'TextBox', N'DeptDescription')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (386, N't_Employee_JobTitle', N'JobTitleID', N'Job Title ID', N'Label', N'UniqueID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (387, N't_Employee_JobTitle', N'JobTitle', N'Enter Job Title', N'TextBox', N'JobTitle')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (388, N't_Employee_JobTitle', N'DeptID', N'Enter Dept ID', N'DropDown', N'DeptID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (389, N't_Employee_JobTitle', N'DefaultFacilityID', N'Enter Default Facility ID', N'DropDown', N'DefaultFacilityID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (390, N't_Employee_JobTitle', N'EffectiveDate', N'Enter Effective Date', N'TextBox', N'EffectiveDate')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (395, N't_Productivity_ClockID_Xref', N'ID', N'ID', N'Label', N'UniqueID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (396, N't_Productivity_ClockID_Xref', N'EmpFacilityClockID', N'Enter Emp Facility Clock ID', N'TextBox', N'EmpFacilityClockID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (397, N't_Productivity_ClockID_Xref', N'FacilityID', N'Enter Facility ID', N'DropDown', N'FacilityID')

    INSERT [Common].[t_TblMaint_Col_Comments] ([CCOM_ID], [TableName], [ColumnName], [ColumnComment], [ControlType], [ColumnAlias]) VALUES (398, N't_Productivity_ClockID_Xref', N'EffectiveDate', N'Enter Effective Date', N'TextBox', N'EffectiveDate')

    SET IDENTITY_INSERT [Common].[t_TblMaint_Col_Comments] OFF

    below is my three tables script which i used for my script and also insert script

    /****** Object: StoredProcedure [Common].[p_Admin_InsertTblMaintData] Script Date: 06/07/2013 12:18:55 ******/

    SET ANSI_NULLS ON

    GO

    SET QUOTED_IDENTIFIER ON

    GO

    ALTER procedure [Common].[p_Admin_InsertTblMaintData]

    (@strTableName varchar(50), @strTableComment varchar(100), @strDatabaseName varchar(50), @strSchemaName varchar(50), @strIDFieldName varchar(50))

    as

    /*

    Exec [Common].[p_Admin_InsertTblMaintData] 't_Department','Department: Department List','Vision','Common','DeptID'

    */

    begin

    declare @statement nvarchar(max), @cnt int, @strSchTableName varchar(300)

    select @statement = 'insert into Common.t_TblMaint_Tables (TableName, TableComment,DatabaseName, SchemaName, TableIDField) Values ('''

    + @strTableName + ''',''' + @strTableComment + ''',''' + @strDatabaseName + ''',''' + @strSchemaName +''',''' + @strIDFieldName +''')'

    exec sp_executesql @statement

    select @strSchTableName = @strSchemaName + '.' + @strTableName

    declare c cursor

    for

    select

    'insert into Common.[T_TblMaint_Col_Comments]

    (TableName,ColumnName, ColumnComment, ControlType, ColumnAlias)

    values (''' + @strTableName + ''', ''' + name + ''', ''Enter ' + [Common].[f_AddSpaceWhenUCase](name) + ''', ''TextBox'',''' + name + ''' )'

    from syscolumns

    where id = OBJECT_ID(@strSchTableName)

    open c

    fetch c into @statement

    while (@@FETCH_STATUS = 0)

    begin

    exec (@statement)

    fetch next from c into @statement

    end

    close c

    deallocate c

    set @statement = 'Update Common.[T_TblMaint_Col_Comments] set ControlType = ''Label'', ColumnComment =replace(ColumnComment, ''Enter '', '''') where TableName = '''

    + @strTableName +''' and ColumnName in (''' + @strIDFieldName + ''', ''CreatedBy'', ''CreatedDateTime'', ''ModifiedDateTime'',''ModifiedBy'')'

    exec (@statement)

    set @statement = 'Update Common.[T_TblMaint_Col_Comments] set ColumnComment =replace(ColumnComment, ''I D'', ''ID'') where TableName = '''

    + @strTableName + ''''

    exec (@statement)

    --set @statement = 'Update Common.[T_TblMaint_Col_Comments] set ColumnAlias = ''UniqueID'' where COLUMNPROPERTY(object_id(''' + @strSchTableName + ', ColumnName, ''isidentity'')=1 '

    set @statement = 'Update Common.[T_TblMaint_Col_Comments] set ColumnAlias = ''UniqueID'' where ColumnAlias =''' + @strIDFieldName + ''' and TableName = ''' + @strTableName + ''''

    exec (@statement)

    end

    Below is my stored procedure which inserting records in to tables.

    Go

    /*Department */

    Exec [Common].[p_Admin_InsertTblMaintData] 't_Department','Department: Department List','Vision','Common','DeptID'

    Delete From Common.t_TblMaint_Col_Comments

    Where [TableName] = 't_Department' and [ColumnName] = 'CreatedBy'

    Delete From Common.t_TblMaint_Col_Comments

    Where [TableName] = 't_Department' and [ColumnName] = 'CreatedDateTime'

    Delete From Common.t_TblMaint_Col_Comments

    Where [TableName] = 't_Department' and [ColumnName] = 'ModifiedBy'

    Delete From Common.t_TblMaint_Col_Comments

    Where [TableName] = 't_Department' and [ColumnName] = 'ModifiedDateTime'

    Insert Into Common.t_TblMaint_Col_DropDownData (CCOM_ID,LookupTableName,IDFieldName,ValueFieldName,RequiresEmptyValue)

    Values (279,'Common.t_Department','DeptID','DeptDescription','0')

    -----------------------------------------------------------------

    /*Employee Job Titles */

    Exec [Common].[p_Admin_InsertTblMaintData] 't_Employee_JobTitle','Job Titles:Job Titles to Department ','Vision','Common','JobTitleID'

    Delete From Common.t_TblMaint_Col_Comments

    Where [TableName] = 't_Employee_JobTitle' and [ColumnName] = 'CreatedBy'

    Delete From Common.t_TblMaint_Col_Comments

    Where [TableName] = 't_Employee_JobTitle' and [ColumnName] = 'CreatedDateTime'

    Delete From Common.t_TblMaint_Col_Comments

    Where [TableName] = 't_Employee_JobTitle' and [ColumnName] = 'ModifiedBy'

    Delete From Common.t_TblMaint_Col_Comments

    Where [TableName] = 't_Employee_JobTitle' and [ColumnName] = 'ModifiedDateTime'

    Update [Common].[t_TblMaint_Col_Comments]

    Set ControlType = 'DropDown'

    Where TableName = 't_Employee_JobTitle' and ColumnName = 'DefaultFacilityID'

    Update [Common].[t_TblMaint_Col_Comments]

    Set ControlType = 'DropDown'

    Where TableName = 't_Employee_JobTitle' and ColumnName = 'DeptID'

    Insert Into Common.t_TblMaint_Col_DropDownData (CCOM_ID,LookupTableName,IDFieldName,ValueFieldName,RequiresEmptyValue)

    Values (288,'Common.t_Department','DeptID','DeptDescription','0')

    Insert Into Common.t_TblMaint_Col_DropDownData (CCOM_ID,LookupTableName,IDFieldName,ValueFieldName,RequiresEmptyValue)

    Values (289,'Common.t_Facility','FacilityID','FacilityName','0')

    ---------------------------------------------------------------------

    /*Clock IDs to Facilities*/

    Exec [Common].[p_Admin_InsertTblMaintData] 't_Productivity_ClockID_Xref','Clock IDs:Clock IDs to Facilitie ','Vision','[External]','ID'

    Update [Common].[t_TblMaint_Col_Comments]

    Set ControlType = 'DropDown'

    Where TableName = 't_Productivity_ClockID_Xref' and ColumnName = 'FacilityID'

    Insert Into Common.t_TblMaint_Col_DropDownData (CCOM_ID,LookupTableName,IDFieldName,ValueFieldName,RequiresEmptyValue)

    Values (297,'Common.t_Facility','FacilityID','FacilityName','0')

    Go

    for first time running perfactl alright but when I am trying to couple of times then give me error.

  • Good job posting ddl and lots of details. However you ddl does not contain any primary keys. Can you post the primary keys?

    Also, fwiw you do not need a cursor for this. You can do this all in one step.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • Thanks to reply me back.......

    Below is my primary key script

    /****** Object: Index [PK_T_TBLMAINT_COL_COMMENTS] Script Date: 06/07/2013 12:48:38 ******/

    IF EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[Common].[t_TblMaint_Col_Comments]') AND name = N'PK_T_TBLMAINT_COL_COMMENTS')

    ALTER TABLE [Common].[t_TblMaint_Col_Comments] DROP CONSTRAINT [PK_T_TBLMAINT_COL_COMMENTS]

    GO

    /****** Object: Index [PK_T_TBLMAINT_COL_COMMENTS] Script Date: 06/07/2013 12:48:38 ******/

    ALTER TABLE [Common].[t_TblMaint_Col_Comments] ADD CONSTRAINT [PK_T_TBLMAINT_COL_COMMENTS] PRIMARY KEY CLUSTERED

    (

    [TableName] ASC,

    [ColumnName] 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, FILLFACTOR = 80) ON [PRIMARY]

    GO

    /****** Object: Index [PK_T_TBLMAINT_TABLES] Script Date: 06/07/2013 12:49:16 ******/

    IF EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[Common].[t_TblMaint_Tables]') AND name = N'PK_T_TBLMAINT_TABLES')

    ALTER TABLE [Common].[t_TblMaint_Tables] DROP CONSTRAINT [PK_T_TBLMAINT_TABLES]

    GO

    /****** Object: Index [PK_T_TBLMAINT_TABLES] Script Date: 06/07/2013 12:49:16 ******/

    ALTER TABLE [Common].[t_TblMaint_Tables] ADD CONSTRAINT [PK_T_TBLMAINT_TABLES] PRIMARY KEY CLUSTERED

    (

    [TableName] 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, FILLFACTOR = 80) ON [PRIMARY]

    GO

  • Once I add the primary keys, the insert statements you posted have lots of duplicate key errors.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • Yes You are right because primary key created on TableName and Columnname Column......

    and I am inserting same tablename and columnanme into table .But I have to ,this the business logic for

    Table Maintenance from User side they can manage that table properties based on report in application side.

    Is that any way I can disable that constraint without affecting data and ones insert data enable that.

    or any other solution.....?????

  • zoom19 (6/7/2013)


    Yes You are right because primary key created on TableName and Columnname Column......

    and I am inserting same tablename and columnanme into table .But I have to ,this the business logic for

    Table Maintenance from User side they can manage that table properties based on report in application side.

    Is that any way I can disable that constraint without affecting data and ones insert data enable that.

    or any other solution.....?????

    Well you can't just temporarily disable a primary key. And you absolutely cannot remove the primary key to allow inserting duplicates and then make that a primary key again. That is the point of a primary key. It MUST be unique so you can identify the row. Seems to me that the design is a bit flawed for whatever it is you are trying to do here.

    As a side note, using prefixes like "t_" are considered to be against best practices. You have also used the "tbl" prefix. This has resulted in you having table names like "t_tblSomething". I guess you can know for certain is a table twice. 😉 I would drop both of the prefixes.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • I have to say the Unique Key with a database table is usually SCHEMA, TABLE, and COLUMN, as it is possible to have two tables named the same in different Schemas.

    If this is a centralised database, that pulls metadata from multiple datbases, then you would also want to add in DATABASE as part of any Primary Key.

    I would aslo look at Seans suggestion regarding the naming conventions. However if this is part of an internal coding standards then you may not be able to implement it.

    _________________________________________________________________________
    SSC Guide to Posting and Best Practices

  • Sean :Thanks for suggestion...:-)..

    Jason : Thanks You to review and give suggestion......(If you can find any other please let me update)...:-)

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply