GO
USE [master]
GO

IF NOT EXISTS (SELECT name FROM master.dbo.sysdatabases WHERE name = N'TelsaCo') 
 CREATE DATABASE [TelsaCo]  ON (NAME = N'TelsaCo', FILENAME = N'#SQLPATH\TelsaCo.MDF' , SIZE = 104, FILEGROWTH = 20) 
 LOG ON (NAME = N'TelsaCo_Log', FILENAME = N'#SQLPATH\TelsaCo_Log.LDF' , SIZE = 23, FILEGROWTH = 10) COLLATE Arabic_CI_AS 
ALTER DATABASE TelsaCo SET AUTO_CLOSE OFF
ALTER DATABASE TelsaCo SET RECOVERY BULK_LOGGED
ALTER DATABASE TelsaCo SET RECOVERY SIMPLE
ALTER DATABASE TelsaCo SET TORN_PAGE_DETECTION ON
ALTER DATABASE TelsaCo SET READ_WRITE
ALTER DATABASE TelsaCo SET MULTI_USER
ALTER DATABASE TelsaCo SET MULTI_USER
ALTER DATABASE TelsaCo SET AUTO_SHRINK ON
ALTER DATABASE TelsaCo SET ANSI_NULL_DEFAULT OFF
ALTER DATABASE TelsaCo SET RECURSIVE_TRIGGERS OFF
ALTER DATABASE TelsaCo SET ANSI_NULLS OFF
ALTER DATABASE TelsaCo SET CONCAT_NULL_YIELDS_NULL OFF
ALTER DATABASE TelsaCo SET CURSOR_CLOSE_ON_COMMIT OFF
ALTER DATABASE TelsaCo SET CURSOR_DEFAULT GLOBAL
ALTER DATABASE TelsaCo SET QUOTED_IDENTIFIER OFF
ALTER DATABASE TelsaCo SET ANSI_WARNINGS OFF
ALTER DATABASE TelsaCo SET AUTO_CREATE_STATISTICS ON
ALTER DATABASE TelsaCo SET AUTO_UPDATE_STATISTICS ON

GO
USE [TelsaCo]
GO


GO

GO
CREATE TABLE [dbo].[CallCenterFormat] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_CallCenterFormat_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [CallCenterFormat] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_CallCenterFormat_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [CallCenterFormat] ADD   [chPatternName] nvarchar(MAX)  NULL
 GO
ALTER TABLE [CallCenterFormat] ADD   [chPatternKey] nvarchar(MAX)  NULL
 GO
ALTER TABLE [CallCenterFormat] ADD   [chPatternFormat] nvarchar(MAX)  NULL
 GO
ALTER TABLE [CallCenterFormat] ADD   [chFilter] nvarchar(MAX)  NULL
 GO
ALTER TABLE [CallCenterFormat] ADD   [chTransfer] nvarchar(MAX)  NULL
 GO
ALTER TABLE [CallCenterFormat] ADD   [chInternal] nvarchar(MAX)  NULL
 GO
ALTER TABLE [CallCenterFormat] ADD   [chIsNotAnswer] nvarchar(MAX)  NULL
 GO
ALTER TABLE [CallCenterFormat] ADD   [chRowSpliter] nvarchar(MAX)  NULL
 GO
ALTER TABLE [CallCenterFormat] ADD   [iDirection] int  NULL
 GO
ALTER TABLE [CallCenterFormat] ADD   [PhysicalLayerId] uniqueidentifier  NOT NULL
 GO

GO
ALTER TABLE [CallCenterFormat] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[CallCenterMessage] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_CallCenterMessage_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [CallCenterMessage] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_CallCenterMessage_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [CallCenterMessage] ADD   [MessageID] int IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [CallCenterMessage] ADD   [RawMessage] nvarchar(400)  NULL
 GO
ALTER TABLE [CallCenterMessage] ADD   [Status] int  NULL
 GO
ALTER TABLE [CallCenterMessage] ADD   [ServerName] nvarchar(60)  NULL
 GO
ALTER TABLE [CallCenterMessage] ADD   [PhysicalLayerId] uniqueidentifier  NULL
 GO
ALTER TABLE [CallCenterMessage] ADD   [StartDate] int  NULL
 GO
ALTER TABLE [CallCenterMessage] ADD   [StartTime] int  NULL
 GO
ALTER TABLE [CallCenterMessage] ADD   [Ext] nvarchar(20)  NULL
 GO
ALTER TABLE [CallCenterMessage] ADD   [Co] nvarchar(20)  NULL
 GO
ALTER TABLE [CallCenterMessage] ADD   [Direction] int  NULL
 GO
ALTER TABLE [CallCenterMessage] ADD   [CallNumber] nvarchar(100)  NULL
 GO
ALTER TABLE [CallCenterMessage] ADD   [CallerID] nvarchar(100)  NULL
 GO
ALTER TABLE [CallCenterMessage] ADD   [Ring] int  NULL
 GO
ALTER TABLE [CallCenterMessage] ADD   [Duration] int  NULL
 GO
ALTER TABLE [CallCenterMessage] ADD   [IsInternal] bit  NULL
 GO
ALTER TABLE [CallCenterMessage] ADD   [IsTransfer] bit  NULL
 GO
ALTER TABLE [CallCenterMessage] ADD   [IsNotAnswer] bit  NULL
 GO
ALTER TABLE [CallCenterMessage] ADD   [IsDeleted] bit  NULL
 GO
ALTER TABLE [CallCenterMessage] ADD   [PhoneBookId] int  NULL
 GO
ALTER TABLE [CallCenterMessage] ADD   [PhoneBookName] nvarchar(100)  NULL
 GO
ALTER TABLE [CallCenterMessage] ADD   [RelatedID] int  NULL
 GO
ALTER TABLE [CallCenterMessage] ADD   [CallID] uniqueidentifier  NULL
 GO
ALTER TABLE [CallCenterMessage] ADD   [Pals] int  NULL
 GO
ALTER TABLE [CallCenterMessage] ADD   [Comment] nvarchar(100)  NULL
 GO

GO
ALTER TABLE [CallCenterMessage] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[CallCenterPhysicalLayer] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_CallCenterPhysicalLayer_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [CallCenterPhysicalLayer] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_CallCenterPhysicalLayer_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [CallCenterPhysicalLayer] ADD   [PortType] nvarchar(10)  NOT NULL
 GO
ALTER TABLE [CallCenterPhysicalLayer] ADD   [Port] nvarchar(20)  NOT NULL
 GO
ALTER TABLE [CallCenterPhysicalLayer] ADD   [ComputerName]    nvarchar(100) NULL
 GO

GO
ALTER TABLE [CallCenterPhysicalLayer] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[OfflineCallInfo] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_OfflineCallInfo_TF_Id] DEFAULT ((newid()))  , 
  [CallID] uniqueidentifier  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [OfflineCallInfo] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_OfflineCallInfo_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [OfflineCallInfo] ADD   [IsProccesedMsg] bit  NOT NULL
 CONSTRAINT [DF_OfflineCallInfo_IsProccesedMsg] DEFAULT (((0))) 
GO
ALTER TABLE [OfflineCallInfo] ADD   [CallID] uniqueidentifier  NOT NULL
 GO
ALTER TABLE [OfflineCallInfo] ADD   [Row] int IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [OfflineCallInfo] ADD   [RecordServerID] int  NULL
 GO
ALTER TABLE [OfflineCallInfo] ADD   [CardID] int  NULL
 GO
ALTER TABLE [OfflineCallInfo] ADD   [ChannelID] int  NULL
 GO
ALTER TABLE [OfflineCallInfo] ADD   [LocationID] uniqueidentifier  NULL
 GO
ALTER TABLE [OfflineCallInfo] ADD   [PhoneBookName] nvarchar(MAX)  NULL
 GO
ALTER TABLE [OfflineCallInfo] ADD   [PhoneBookPercent] int  NULL
 GO
ALTER TABLE [OfflineCallInfo] ADD   [Comment] nvarchar(400)  NULL
 GO
ALTER TABLE [OfflineCallInfo] ADD   [Refrence] nvarchar(100)  NULL
 GO
ALTER TABLE [OfflineCallInfo] ADD   [IsMark] bit  NULL
 GO
ALTER TABLE [OfflineCallInfo] ADD   [IsArchived] smallint  NULL
 GO
ALTER TABLE [OfflineCallInfo] ADD   [PalsNumber] nvarchar(100)  NULL
 GO
ALTER TABLE [OfflineCallInfo] ADD   [PRICallerID] nvarchar(100)  NULL
 GO
ALTER TABLE [OfflineCallInfo] ADD   [PRINumber] nvarchar(100)  NULL
 GO
ALTER TABLE [OfflineCallInfo] ADD   [PRISubscriber] nvarchar(100)  NULL
 GO
ALTER TABLE [OfflineCallInfo] ADD   [PhoneBookID] int  NULL
 GO
ALTER TABLE [OfflineCallInfo] ADD   [PlayLock] smallint  NULL
 GO
ALTER TABLE [OfflineCallInfo] ADD   [CartablID] int  NULL
 GO
ALTER TABLE [OfflineCallInfo] ADD   [SecurityCartablID] nvarchar(100)  NULL
 GO
ALTER TABLE [OfflineCallInfo] ADD   [FaxID] uniqueidentifier  NULL
 GO
ALTER TABLE [OfflineCallInfo] ADD   [IsDeleted] smallint  NULL
 GO
ALTER TABLE [OfflineCallInfo] ADD   [IsProcessed] smallint  NULL
 GO
ALTER TABLE [OfflineCallInfo] ADD   [OfflineCid] nvarchar(100)  NULL
 GO
ALTER TABLE [OfflineCallInfo] ADD   [CallCenterTone] nvarchar(100)  NULL
 GO
ALTER TABLE [OfflineCallInfo] ADD   [CallCenterCid] nvarchar(100)  NULL
 GO
ALTER TABLE [OfflineCallInfo] ADD   [Mdc] nvarchar(100)  NULL
 GO
ALTER TABLE [OfflineCallInfo] ADD   [CallerIDType] nvarchar(100)  NULL
 GO
ALTER TABLE [OfflineCallInfo] ADD   [Played] smallint  NULL
 GO
ALTER TABLE [OfflineCallInfo] ADD   [CallType] nvarchar(100)  NULL
 GO
ALTER TABLE [OfflineCallInfo] ADD   [FilesCount] smallint  NULL
 GO
ALTER TABLE [OfflineCallInfo] ADD   [CallNumbers] nvarchar(100)  NULL
 GO
ALTER TABLE [OfflineCallInfo] ADD   [CallerID] nvarchar(100)  NULL
 GO
ALTER TABLE [OfflineCallInfo] ADD   [CallCenterSubscriber] nvarchar(100)  NULL
 GO
ALTER TABLE [OfflineCallInfo] ADD   [OfflineTone] nvarchar(100)  NULL
 GO
ALTER TABLE [OfflineCallInfo] ADD   [GregorianStartSaveDateTime] bigint  NULL
 GO
ALTER TABLE [OfflineCallInfo] ADD   [WeekDay] smallint  NULL
 GO
ALTER TABLE [OfflineCallInfo] ADD   [StartSaveMode] nvarchar(100)  NULL
 GO
ALTER TABLE [OfflineCallInfo] ADD   [EndSaveMode] nvarchar(100)  NULL
 GO
ALTER TABLE [OfflineCallInfo] ADD   [RingCount] smallint  NULL
 GO
ALTER TABLE [OfflineCallInfo] ADD   [Duration] int  NULL
 GO
ALTER TABLE [OfflineCallInfo] ADD   [FileName] nvarchar(120)  NULL
 GO
ALTER TABLE [OfflineCallInfo] ADD   [SaveType] int  NULL
 GO
ALTER TABLE [OfflineCallInfo] ADD   [StartSaveDatePersian] int  NULL
 GO
ALTER TABLE [OfflineCallInfo] ADD   [StartSaveDataGregorian] int  NULL
 GO
ALTER TABLE [OfflineCallInfo] ADD   [StartSaveTime] int  NULL
 GO
ALTER TABLE [OfflineCallInfo] ADD   [PersianStartSaveDateTime] bigint  NULL
 GO
ALTER TABLE [OfflineCallInfo] ADD   [IsFax] int  NULL
 GO
ALTER TABLE [OfflineCallInfo] ADD   [IsMp3] int  NULL
 GO
ALTER TABLE [OfflineCallInfo] ADD   [IsEncrypt] int  NULL
 GO
ALTER TABLE [OfflineCallInfo] ADD   [FskDateTime] nvarchar(100)  NULL
 GO

GO
ALTER TABLE [OfflineCallInfo] ADD PRIMARY KEY ([TF_Id], [CallID]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[OfflineCard] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_OfflineCard_TF_Id] DEFAULT ((newid()))  , 
  [CardID] int IDENTITY(1,1) NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [OfflineCard] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_OfflineCard_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [OfflineCard] ADD   [CardID] int IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [OfflineCard] ADD   [RecordServerID] int  NULL
 GO
ALTER TABLE [OfflineCard] ADD   [CardNum] bigint  NULL
 GO
ALTER TABLE [OfflineCard] ADD   [iActive] int  NULL
 GO
ALTER TABLE [OfflineCard] ADD   [Name] varchar(100)  NULL
 GO

GO
ALTER TABLE [OfflineCard] ADD PRIMARY KEY ([TF_Id], [CardID]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[OfflineChannel] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_OfflineChannel_TF_Id] DEFAULT ((newid()))  , 
  [ChannelID] int IDENTITY(1,1) NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [OfflineChannel] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_OfflineChannel_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [OfflineChannel] ADD   [ChannelID] int IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [OfflineChannel] ADD   [RecordServerID] int  NULL
 GO
ALTER TABLE [OfflineChannel] ADD   [CardID] int  NULL
 GO
ALTER TABLE [OfflineChannel] ADD   [ChannelNum] int  NULL
 GO
ALTER TABLE [OfflineChannel] ADD   [Name] varchar(100)  NULL
 GO
ALTER TABLE [OfflineChannel] ADD   [CallCenterCo] varchar(50)  NULL
 GO
ALTER TABLE [OfflineChannel] ADD   [FaxDetection] bit  NULL
 GO
ALTER TABLE [OfflineChannel] ADD   [FaxDecoding] bit  NULL
 GO
ALTER TABLE [OfflineChannel] ADD   [OutputFileType] int  NULL
 GO
ALTER TABLE [OfflineChannel] ADD   [AGC] int  NULL
 GO
ALTER TABLE [OfflineChannel] ADD   [MdcDetection] bit  NULL
 GO
ALTER TABLE [OfflineChannel] ADD   [SilenceDetection] bit  NULL
 GO
ALTER TABLE [OfflineChannel] ADD   [DeleteStars] bit  NULL
 GO
ALTER TABLE [OfflineChannel] ADD   [EncryptFile] bit  NULL
 GO
ALTER TABLE [OfflineChannel] ADD   [SaveMode] varchar(50)  NULL
 GO
ALTER TABLE [OfflineChannel] ADD   [chComment] varchar(50)  NULL
 GO

GO
ALTER TABLE [OfflineChannel] ADD PRIMARY KEY ([TF_Id], [ChannelID]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[OfflineFax] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_OfflineFax_TF_Id] DEFAULT ((newid()))  , 
  [FaxID] uniqueidentifier  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [OfflineFax] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_OfflineFax_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [OfflineFax] ADD   [FaxID] uniqueidentifier  NOT NULL
 GO
ALTER TABLE [OfflineFax] ADD   [Result] smallint  NULL
 GO
ALTER TABLE [OfflineFax] ADD   [PageNo] smallint  NULL
 GO
ALTER TABLE [OfflineFax] ADD   [TiffLocationID] uniqueidentifier  NULL
 GO
ALTER TABLE [OfflineFax] ADD   [TiffName] varchar(100)  NULL
 GO

GO
ALTER TABLE [OfflineFax] ADD PRIMARY KEY ([TF_Id], [FaxID]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[OfflineRecordServerPath] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_OfflineRecordServerPath_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [OfflineRecordServerPath] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_OfflineRecordServerPath_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [OfflineRecordServerPath] ADD   [Path] nvarchar(500)  NOT NULL
 GO
ALTER TABLE [OfflineRecordServerPath] ADD   [UserName] nvarchar(100)  NOT NULL
 CONSTRAINT [DF_OfflineRecordServerPath_UserName] DEFAULT ((N'Administrator')) 
GO
ALTER TABLE [OfflineRecordServerPath] ADD   [Password] nvarchar(100)  NOT NULL
 CONSTRAINT [DF_OfflineRecordServerPath_Password] DEFAULT ((N'TPEUmnXKR1xfncC6bw6/zw==')) 
GO
ALTER TABLE [OfflineRecordServerPath] ADD   [Type] int  NOT NULL
 CONSTRAINT [DF_OfflineRecordServerPath_Type] DEFAULT (1) 
GO
ALTER TABLE [OfflineRecordServerPath] ADD   [IsShadow] int  NOT NULL
 CONSTRAINT [DF_OfflineRecordServerPath_IsShadow] DEFAULT (((0))) 
GO
ALTER TABLE [OfflineRecordServerPath] ADD   [IsActive] int  NOT NULL
 GO
ALTER TABLE [OfflineRecordServerPath] ADD   [RecorderServerPointer] uniqueidentifier  NOT NULL
 GO

GO
ALTER TABLE [OfflineRecordServerPath] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[OfflineRecordServers] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_OfflineRecordServers_TF_Id] DEFAULT ((newid()))  , 
  [ServerID] int IDENTITY(1,1) NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [OfflineRecordServers] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_OfflineRecordServers_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [OfflineRecordServers] ADD   [ServerID] int IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [OfflineRecordServers] ADD   [ServerName] nvarchar(100)  NULL
 GO
ALTER TABLE [OfflineRecordServers] ADD   [ServerIP] nvarchar(100)  NULL
 GO
ALTER TABLE [OfflineRecordServers] ADD   [UserName] nvarchar(100)  NULL
 GO
ALTER TABLE [OfflineRecordServers] ADD   [Password] nvarchar(100)  NULL
 GO
ALTER TABLE [OfflineRecordServers] ADD   [OfflineProcessShare] int  NULL
 GO
ALTER TABLE [OfflineRecordServers] ADD   [IsActive] smallint  NULL
 GO
ALTER TABLE [OfflineRecordServers] ADD   [iType] smallint  NULL
 CONSTRAINT [DF_OfflineRecordServers_iType] DEFAULT (((1))) 
GO
ALTER TABLE [OfflineRecordServers] ADD   [iConnectionType] smallint  NULL
 GO
ALTER TABLE [OfflineRecordServers] ADD   [THWPath] nvarchar(512)  NULL
 GO
ALTER TABLE [OfflineRecordServers] ADD   [IsShadow] int  NULL
 CONSTRAINT [DF_OfflineRecordServers_IsShadow] DEFAULT (((0))) 
GO

GO
ALTER TABLE [OfflineRecordServers] ADD PRIMARY KEY ([TF_Id], [ServerID]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[OfflinePath] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_OfflinePath_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [OfflinePath] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_OfflinePath_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [OfflinePath] ADD   [Path] nvarchar(MAX)  NOT NULL
 GO
ALTER TABLE [OfflinePath] ADD   [GeneralSettingPointer] uniqueidentifier  NOT NULL
 GO
ALTER TABLE [OfflinePath] ADD   [Type] int  NOT NULL
 GO

GO
ALTER TABLE [OfflinePath] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[Managers] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_Managers_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [Managers] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_Managers_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [Managers] ADD   [ManagerID] int IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [Managers] ADD   [ManagerName] nvarchar(100)  NULL
 GO
ALTER TABLE [Managers] ADD   [ManagerCellNumber] nvarchar(40)  NULL
 GO
ALTER TABLE [Managers] ADD   [ManagerEmail] nvarchar(100)  NULL
 GO

GO
ALTER TABLE [Managers] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[SendEmail] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_SendEmail_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [SendEmail] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_SendEmail_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [SendEmail] ADD   [EmailBody] ntext  NULL
 GO
ALTER TABLE [SendEmail] ADD   [EmailAddress] nvarchar(100)  NULL
 GO
ALTER TABLE [SendEmail] ADD   [FromEmail] nvarchar(100)  NULL
 GO
ALTER TABLE [SendEmail] ADD   [PersianRequestDate] nvarchar(40)  NULL
 GO
ALTER TABLE [SendEmail] ADD   [RequestDate] datetime  NOT NULL
 CONSTRAINT [DF_SendEmail_RequestDate] DEFAULT ((getdate())) 
GO
ALTER TABLE [SendEmail] ADD   [PersianSentDate] nvarchar(40)  NULL
 GO
ALTER TABLE [SendEmail] ADD   [SentDate] datetime  NULL
 CONSTRAINT [DF_SendEmail_SentDate] DEFAULT ((getdate())) 
GO
ALTER TABLE [SendEmail] ADD   [Status] bit  NOT NULL
 CONSTRAINT [DF_SendEmail_Status] DEFAULT (((0))) 
GO
ALTER TABLE [SendEmail] ADD   [FilePath] nvarchar(MAX)  NULL
 GO

GO
ALTER TABLE [SendEmail] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[SendMsg] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_SendMsg_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [SendMsg] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_SendMsg_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [SendMsg] ADD   [MessageBody] ntext  NULL
 GO
ALTER TABLE [SendMsg] ADD   [MessageNumber] nvarchar(40)  NULL
 GO
ALTER TABLE [SendMsg] ADD   [UserNameMsg] nvarchar(60)  NULL
 GO
ALTER TABLE [SendMsg] ADD   [PersianRequestDate] nvarchar(40)  NULL
 GO
ALTER TABLE [SendMsg] ADD   [RequestDate] datetime  NOT NULL
 CONSTRAINT [DF_SendMsg_RequestDate] DEFAULT ((getdate())) 
GO
ALTER TABLE [SendMsg] ADD   [FCode] nvarchar(40)  NULL
 GO
ALTER TABLE [SendMsg] ADD   [PersianSentDate] nvarchar(40)  NULL
 GO
ALTER TABLE [SendMsg] ADD   [SentDate] datetime  NULL
 GO
ALTER TABLE [SendMsg] ADD   [Status] bit  NOT NULL
 CONSTRAINT [DF_SendMsg_Status] DEFAULT (((0))) 
GO

GO
ALTER TABLE [SendMsg] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_Bug] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_Bug_TF_Id] DEFAULT ((newid()))  , 
  [iId] bigint IDENTITY(1,1) NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_Bug] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_Bug_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_Bug] ADD   [iId] bigint IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [tblIMS_Bug] ADD   [iUserId] int  NULL
 GO
ALTER TABLE [tblIMS_Bug] ADD   [iDate] int  NULL
 GO
ALTER TABLE [tblIMS_Bug] ADD   [chSystemUserName] nvarchar(400)  NULL
 GO
ALTER TABLE [tblIMS_Bug] ADD   [chFunctionName] nvarchar(600)  NULL
 GO
ALTER TABLE [tblIMS_Bug] ADD   [chInputData] nvarchar(2000)  NULL
 GO
ALTER TABLE [tblIMS_Bug] ADD   [chSQL] nvarchar(2000)  NULL
 GO
ALTER TABLE [tblIMS_Bug] ADD   [chError] nvarchar(2000)  NULL
 GO
ALTER TABLE [tblIMS_Bug] ADD   [bServer] bit  NULL
 GO
ALTER TABLE [tblIMS_Bug] ADD   [iProjectCd] int  NULL
 GO
ALTER TABLE [tblIMS_Bug] ADD   [iNo] int  NULL
 GO
ALTER TABLE [tblIMS_Bug] ADD   [chVersion] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_Bug] ADD   [bManual] bit  NULL
 CONSTRAINT [DF_tblIMS_Bug_bManual] DEFAULT (((0))) 
GO

GO
ALTER TABLE [tblIMS_Bug] ADD PRIMARY KEY ([TF_Id], [iId]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_BugDetail] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_BugDetail_TF_Id] DEFAULT ((newid()))  , 
  [iId] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_BugDetail] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_BugDetail_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_BugDetail] ADD   [iId] int  NOT NULL
 GO
ALTER TABLE [tblIMS_BugDetail] ADD   [iProgrammerId] int  NULL
 GO
ALTER TABLE [tblIMS_BugDetail] ADD   [chProgrammerDes] nvarchar(400)  NULL
 GO
ALTER TABLE [tblIMS_BugDetail] ADD   [iDebugDate] int  NULL
 GO

GO
ALTER TABLE [tblIMS_BugDetail] ADD PRIMARY KEY ([TF_Id], [iId]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_BusinessBenefit] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_BusinessBenefit_TF_Id] DEFAULT ((newid()))  , 
  [iCd] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_BusinessBenefit] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_BusinessBenefit_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_BusinessBenefit] ADD   [iCd] int  NOT NULL
 GO
ALTER TABLE [tblIMS_BusinessBenefit] ADD   [iPrice] int  NULL
 GO
ALTER TABLE [tblIMS_BusinessBenefit] ADD   [iBenefit] int  NULL
 GO

GO
ALTER TABLE [tblIMS_BusinessBenefit] ADD PRIMARY KEY ([TF_Id], [iCd]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_Bylaw] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_Bylaw_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_Bylaw] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_Bylaw_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_Bylaw] ADD   [chCd] nvarchar(50)  NULL
 GO
ALTER TABLE [tblIMS_Bylaw] ADD   [chDes] text  NULL
 GO
ALTER TABLE [tblIMS_Bylaw] ADD   [iUserId] int  NULL
 GO
ALTER TABLE [tblIMS_Bylaw] ADD   [iDate] int  NULL
 GO
ALTER TABLE [tblIMS_Bylaw] ADD   [chColor] nvarchar(11)  NULL
 CONSTRAINT [DF_tblIMS_Bylaw_chColor] DEFAULT ((0)) 
GO

GO
ALTER TABLE [tblIMS_Bylaw] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_Calendar] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_Calendar_TF_Id] DEFAULT ((newid()))  , 
  [iId] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_Calendar] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_Calendar_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_Calendar] ADD   [iId] int  NOT NULL
 GO
ALTER TABLE [tblIMS_Calendar] ADD   [bFix] bit  NULL
 GO
ALTER TABLE [tblIMS_Calendar] ADD   [iUserId] int  NULL
 GO
ALTER TABLE [tblIMS_Calendar] ADD   [iDate] int  NULL
 GO
ALTER TABLE [tblIMS_Calendar] ADD   [chDate] nvarchar(20)  NULL
 GO
ALTER TABLE [tblIMS_Calendar] ADD   [chMDate] nvarchar(20)  NULL
 GO
ALTER TABLE [tblIMS_Calendar] ADD   [iYear] int  NULL
 GO
ALTER TABLE [tblIMS_Calendar] ADD   [chDes] nvarchar(400)  NULL
 GO
ALTER TABLE [tblIMS_Calendar] ADD   [chSMS] nvarchar(400)  NULL
 GO
ALTER TABLE [tblIMS_Calendar] ADD   [bHoliday] bit  NULL
 CONSTRAINT [DF_tblIMS_Calendar_bHoliday] DEFAULT ((0)) 
GO

GO
ALTER TABLE [tblIMS_Calendar] ADD PRIMARY KEY ([TF_Id], [iId]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_Cartabl] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_Cartabl_TF_Id] DEFAULT ((newid()))  , 
  [iId] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_Cartabl] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_Cartabl_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_Cartabl] ADD   [iId] int  NOT NULL
 GO
ALTER TABLE [tblIMS_Cartabl] ADD   [chName] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_Cartabl] ADD   [iParentId] int  NULL
 GO
ALTER TABLE [tblIMS_Cartabl] ADD   [chNote] nvarchar(200)  NULL
 GO
ALTER TABLE [tblIMS_Cartabl] ADD   [chColor] nvarchar(11)  NULL
 CONSTRAINT [DF_tblIMS_Cartabl_chColor] DEFAULT ((0)) 
GO
ALTER TABLE [tblIMS_Cartabl] ADD   [chDTMFCode] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_Cartabl] ADD   [chVoice] nvarchar(200)  NULL
 GO
ALTER TABLE [tblIMS_Cartabl] ADD   [iUserId] int  NULL
 GO
ALTER TABLE [tblIMS_Cartabl] ADD   [iDate] int  NULL
 GO
ALTER TABLE [tblIMS_Cartabl] ADD   [iTreeId] int  NULL
 GO
ALTER TABLE [tblIMS_Cartabl] ADD   [iFixCartablCd] int  NULL
 GO
ALTER TABLE [tblIMS_Cartabl] ADD   [iFId] int  NULL
 GO
ALTER TABLE [tblIMS_Cartabl] ADD   [bWebShow] bit  NULL
 CONSTRAINT [DF_tblIMS_Cartabl_bWebShow] DEFAULT ((0)) 
GO
ALTER TABLE [tblIMS_Cartabl] ADD   [chIP] nvarchar(24)  NULL
 GO

GO
ALTER TABLE [tblIMS_Cartabl] ADD PRIMARY KEY ([TF_Id], [iId]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_City] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_City_TF_Id] DEFAULT ((newid()))  , 
  [iCd] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_City] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_City_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_City] ADD   [iCd] int  NOT NULL
 GO
ALTER TABLE [tblIMS_City] ADD   [chDes] nvarchar(200)  NULL
 GO

GO
ALTER TABLE [tblIMS_City] ADD PRIMARY KEY ([TF_Id], [iCd]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_CityTelCd] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_CityTelCd_TF_Id] DEFAULT ((newid()))  , 
  [iId] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_CityTelCd] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_CityTelCd_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_CityTelCd] ADD   [iId] int  NOT NULL
 GO
ALTER TABLE [tblIMS_CityTelCd] ADD   [iMumCd] int  NULL
 GO
ALTER TABLE [tblIMS_CityTelCd] ADD   [chTelCd] nvarchar(20)  NULL
 GO
ALTER TABLE [tblIMS_CityTelCd] ADD   [chDes] nvarchar(200)  NULL
 GO

GO
ALTER TABLE [tblIMS_CityTelCd] ADD PRIMARY KEY ([TF_Id], [iId]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_CJobGroup] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_CJobGroup_TF_Id] DEFAULT ((newid()))  , 
  [iCd] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_CJobGroup] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_CJobGroup_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_CJobGroup] ADD   [iCd] int  NOT NULL
 GO
ALTER TABLE [tblIMS_CJobGroup] ADD   [chDes] nvarchar(200)  NULL
 GO

GO
ALTER TABLE [tblIMS_CJobGroup] ADD PRIMARY KEY ([TF_Id], [iCd]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_CompanyBuilding] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_CompanyBuilding_TF_Id] DEFAULT ((newid()))  , 
  [iCd] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_CompanyBuilding] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_CompanyBuilding_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_CompanyBuilding] ADD   [iCd] int  NOT NULL
 GO
ALTER TABLE [tblIMS_CompanyBuilding] ADD   [chName] nvarchar(200)  NULL
 GO
ALTER TABLE [tblIMS_CompanyBuilding] ADD   [chAddress] nvarchar(500)  NULL
 GO

GO
ALTER TABLE [tblIMS_CompanyBuilding] ADD PRIMARY KEY ([TF_Id], [iCd]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_CompanyPerson] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_CompanyPerson_TF_Id] DEFAULT ((newid()))  , 
  [iId] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_CompanyPerson] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_CompanyPerson_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_CompanyPerson] ADD   [iUserId] int  NULL
 GO
ALTER TABLE [tblIMS_CompanyPerson] ADD   [iId] int  NOT NULL
 GO
ALTER TABLE [tblIMS_CompanyPerson] ADD   [chName] nvarchar(200)  NULL
 GO
ALTER TABLE [tblIMS_CompanyPerson] ADD   [chPFName] nvarchar(200)  NULL
 GO
ALTER TABLE [tblIMS_CompanyPerson] ADD   [iCJobGroupCd] int  NULL
 GO
ALTER TABLE [tblIMS_CompanyPerson] ADD   [iCType] int  NULL
 GO
ALTER TABLE [tblIMS_CompanyPerson] ADD   [iCityCd] int  NULL
 GO
ALTER TABLE [tblIMS_CompanyPerson] ADD   [chFax] nvarchar(40)  NULL
 GO
ALTER TABLE [tblIMS_CompanyPerson] ADD   [chTel1] nvarchar(40)  NULL
 GO
ALTER TABLE [tblIMS_CompanyPerson] ADD   [chTel2] nvarchar(40)  NULL
 GO
ALTER TABLE [tblIMS_CompanyPerson] ADD   [chTel3] nvarchar(40)  NULL
 GO
ALTER TABLE [tblIMS_CompanyPerson] ADD   [chTel4] nvarchar(40)  NULL
 GO
ALTER TABLE [tblIMS_CompanyPerson] ADD   [chTel5] nvarchar(40)  NULL
 GO
ALTER TABLE [tblIMS_CompanyPerson] ADD   [chTel6] nvarchar(40)  NULL
 GO
ALTER TABLE [tblIMS_CompanyPerson] ADD   [chTel7] nvarchar(40)  NULL
 GO
ALTER TABLE [tblIMS_CompanyPerson] ADD   [chTel8] nvarchar(40)  NULL
 GO
ALTER TABLE [tblIMS_CompanyPerson] ADD   [chTel9] nvarchar(40)  NULL
 GO
ALTER TABLE [tblIMS_CompanyPerson] ADD   [chTel10] nvarchar(40)  NULL
 GO
ALTER TABLE [tblIMS_CompanyPerson] ADD   [chMobile] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_CompanyPerson] ADD   [chE_Mail] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_CompanyPerson] ADD   [chWeb_Page] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_CompanyPerson] ADD   [chPostalCode] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_CompanyPerson] ADD   [chAddress] nvarchar(510)  NULL
 GO
ALTER TABLE [tblIMS_CompanyPerson] ADD   [chNote] nvarchar(510)  NULL
 GO
ALTER TABLE [tblIMS_CompanyPerson] ADD   [iPJobTitleCd] int  NULL
 GO
ALTER TABLE [tblIMS_CompanyPerson] ADD   [bC] bit  NULL
 GO
ALTER TABLE [tblIMS_CompanyPerson] ADD   [iCId] int  NULL
 GO
ALTER TABLE [tblIMS_CompanyPerson] ADD   [bDelete] bit  NULL
 CONSTRAINT [DF_tblIMS_CompanyPerson_bDelete] DEFAULT (((0))) 
GO
ALTER TABLE [tblIMS_CompanyPerson] ADD   [iDate] int  NULL
 GO
ALTER TABLE [tblIMS_CompanyPerson] ADD   [iCustNo] int  NULL
 CONSTRAINT [DF_tblIMS_CompanyPerson_iCustNo] DEFAULT (((-1))) 
GO
ALTER TABLE [tblIMS_CompanyPerson] ADD   [iCustLevelCd] int  NULL
 CONSTRAINT [DF_tblIMS_CompanyPerson_iCustLevelCd] DEFAULT (((-1))) 
GO
ALTER TABLE [tblIMS_CompanyPerson] ADD   [chAtachFile] nvarchar(200)  NULL
 GO

GO
ALTER TABLE [tblIMS_CompanyPerson] ADD PRIMARY KEY ([TF_Id], [iId]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_CompanyPersonTell] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_CompanyPersonTell_TF_Id] DEFAULT ((newid()))  , 
  [iId] int IDENTITY(1,1) NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_CompanyPersonTell] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_CompanyPersonTell_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_CompanyPersonTell] ADD   [iId] int IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [tblIMS_CompanyPersonTell] ADD   [iCPId] int  NULL
 GO
ALTER TABLE [tblIMS_CompanyPersonTell] ADD   [chTel] nvarchar(60)  NULL
 GO

GO
ALTER TABLE [tblIMS_CompanyPersonTell] ADD PRIMARY KEY ([TF_Id], [iId]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_CompanyUnit] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_CompanyUnit_TF_Id] DEFAULT ((newid()))  , 
  [iCd] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_CompanyUnit] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_CompanyUnit_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_CompanyUnit] ADD   [iCd] int  NOT NULL
 GO
ALTER TABLE [tblIMS_CompanyUnit] ADD   [chDes] nvarchar(200)  NULL
 GO

GO
ALTER TABLE [tblIMS_CompanyUnit] ADD PRIMARY KEY ([TF_Id], [iCd]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_CustLevel] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_CustLevel_TF_Id] DEFAULT ((newid()))  , 
  [iCd] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_CustLevel] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_CustLevel_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_CustLevel] ADD   [iCd] int  NOT NULL
 GO
ALTER TABLE [tblIMS_CustLevel] ADD   [chDes] nvarchar(200)  NULL
 GO

GO
ALTER TABLE [tblIMS_CustLevel] ADD PRIMARY KEY ([TF_Id], [iCd]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_Debug] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_Debug_TF_Id] DEFAULT ((newid()))  , 
  [iId] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_Debug] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_Debug_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_Debug] ADD   [iId] int  NOT NULL
 GO
ALTER TABLE [tblIMS_Debug] ADD   [chInstallDate] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_Debug] ADD   [iPId] int  NULL
 GO
ALTER TABLE [tblIMS_Debug] ADD   [iCPId] int  NULL
 GO
ALTER TABLE [tblIMS_Debug] ADD   [iUserNo] int  NULL
 GO
ALTER TABLE [tblIMS_Debug] ADD   [iAccess] int  NULL
 GO
ALTER TABLE [tblIMS_Debug] ADD   [iNet] int  NULL
 GO
ALTER TABLE [tblIMS_Debug] ADD   [chOS] nvarchar(1000)  NULL
 GO
ALTER TABLE [tblIMS_Debug] ADD   [chInstallSoft] nvarchar(1000)  NULL
 GO
ALTER TABLE [tblIMS_Debug] ADD   [chSysUsage] nvarchar(1000)  NULL
 GO
ALTER TABLE [tblIMS_Debug] ADD   [chDes] text  NULL
 GO
ALTER TABLE [tblIMS_Debug] ADD   [iDate] int  NULL
 GO
ALTER TABLE [tblIMS_Debug] ADD   [iUserId] int  NULL
 GO
ALTER TABLE [tblIMS_Debug] ADD   [bDelete] bit  NULL
 GO

GO
ALTER TABLE [tblIMS_Debug] ADD PRIMARY KEY ([TF_Id], [iId]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_DebugInf] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_DebugInf_TF_Id] DEFAULT ((newid()))  , 
  [iDebugId] int  NOT NULL , 
  [iRow] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_DebugInf] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_DebugInf_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_DebugInf] ADD   [iDebugId] int  NOT NULL
 GO
ALTER TABLE [tblIMS_DebugInf] ADD   [iRow] int  NOT NULL
 GO
ALTER TABLE [tblIMS_DebugInf] ADD   [iProjectCd] int  NULL
 GO
ALTER TABLE [tblIMS_DebugInf] ADD   [chProblem] text  NULL
 GO
ALTER TABLE [tblIMS_DebugInf] ADD   [chSoloution] text  NULL
 GO

GO
ALTER TABLE [tblIMS_DebugInf] ADD PRIMARY KEY ([TF_Id], [iDebugId], [iRow]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_DebugProposal] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_DebugProposal_TF_Id] DEFAULT ((newid()))  , 
  [iDebugId] int  NOT NULL , 
  [iRow] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_DebugProposal] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_DebugProposal_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_DebugProposal] ADD   [iDebugId] int  NOT NULL
 GO
ALTER TABLE [tblIMS_DebugProposal] ADD   [iRow] int  NOT NULL
 GO
ALTER TABLE [tblIMS_DebugProposal] ADD   [iProjectCd] int  NULL
 GO
ALTER TABLE [tblIMS_DebugProposal] ADD   [chProposal] text  NULL
 GO

GO
ALTER TABLE [tblIMS_DebugProposal] ADD PRIMARY KEY ([TF_Id], [iDebugId], [iRow]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_DocType] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_DocType_TF_Id] DEFAULT ((newid()))  , 
  [iCd] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_DocType] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_DocType_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_DocType] ADD   [iCd] int  NOT NULL
 GO
ALTER TABLE [tblIMS_DocType] ADD   [chDes] nvarchar(200)  NULL
 GO

GO
ALTER TABLE [tblIMS_DocType] ADD PRIMARY KEY ([TF_Id], [iCd]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_Employ] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_Employ_TF_Id] DEFAULT ((newid()))  , 
  [iId] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_Employ] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_Employ_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_Employ] ADD   [iId] int  NOT NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [iDate] int  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [bEmploy] bit  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [bSex] bit  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [iSoldierState] int  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [chFName] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [chLName] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [iBirthDate] int  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [iCityCd] int  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [chDadName] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [chShNo] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [chMeliCd] nvarchar(24)  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [chNationality] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [iReligion] int  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [bSingle] bit  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [iChildNo] int  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [chHomeTel] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [chMobileTel] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [chEmergencyTel] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [chE_Mail] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [chHomeAddress] text  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [chLang1] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [chLang2] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [chLang3] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [chLang4] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [chLang5] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [iSpeakingLang1] int  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [iSpeakingLang2] int  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [iSpeakingLang3] int  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [iSpeakingLang4] int  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [iSpeakingLang5] int  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [iVocabularyLang1] int  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [iVocabularyLang2] int  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [iVocabularyLang3] int  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [iVocabularyLang4] int  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [iVocabularyLang5] int  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [iWritingLang1] int  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [iWritingLang2] int  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [iWritingLang3] int  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [iWritingLang4] int  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [iWritingLang5] int  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [chA] text  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [chB] text  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [chC] text  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [chD] text  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [chE] text  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [chF] text  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [chG] text  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [iCooperationType] int  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [iSalaryPrice] int  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [chPNote] text  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [bHolidayWork] bit  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [iFamiliarTool] int  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [chPresentMan] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [iLikeGroupWork] int  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [iLikeReligion] int  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [bPenalHistory] bit  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [bSmooking] bit  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [ch1] text  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [ch2] text  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [ch3] text  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [chItem1] text  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [chItem2] text  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [chItem3] text  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [chItem4] text  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [chItem5] text  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [chItem6] text  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [chItem7] text  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [chItem8] text  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [iEmploy] int  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [iCompanyUnitCd] int  NULL
 GO
ALTER TABLE [tblIMS_Employ] ADD   [iCompanyPersonId] int  NULL
 GO

GO
ALTER TABLE [tblIMS_Employ] ADD PRIMARY KEY ([TF_Id], [iId]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_EmployKnowledge] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_EmployKnowledge_TF_Id] DEFAULT ((newid()))  , 
  [iRow] int  NOT NULL , 
  [iEmployId] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_EmployKnowledge] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_EmployKnowledge_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_EmployKnowledge] ADD   [iRow] int  NOT NULL
 GO
ALTER TABLE [tblIMS_EmployKnowledge] ADD   [iEmployId] int  NOT NULL
 GO
ALTER TABLE [tblIMS_EmployKnowledge] ADD   [chName] nvarchar(20)  NULL
 GO
ALTER TABLE [tblIMS_EmployKnowledge] ADD   [chText] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_EmployKnowledge] ADD   [iGrade] int  NULL
 GO

GO
ALTER TABLE [tblIMS_EmployKnowledge] ADD PRIMARY KEY ([TF_Id], [iRow], [iEmployId]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_EmployOpinion] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_EmployOpinion_TF_Id] DEFAULT ((newid()))  , 
  [iEmployId] int  NOT NULL , 
  [iUserId] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_EmployOpinion] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_EmployOpinion_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_EmployOpinion] ADD   [iEmployId] int  NOT NULL
 GO
ALTER TABLE [tblIMS_EmployOpinion] ADD   [iUserId] int  NOT NULL
 GO
ALTER TABLE [tblIMS_EmployOpinion] ADD   [iItem1] int  NULL
 GO
ALTER TABLE [tblIMS_EmployOpinion] ADD   [iItem2] int  NULL
 GO
ALTER TABLE [tblIMS_EmployOpinion] ADD   [iItem3] int  NULL
 GO
ALTER TABLE [tblIMS_EmployOpinion] ADD   [iItem4] int  NULL
 GO
ALTER TABLE [tblIMS_EmployOpinion] ADD   [iItem5] int  NULL
 GO
ALTER TABLE [tblIMS_EmployOpinion] ADD   [iItem6] int  NULL
 GO
ALTER TABLE [tblIMS_EmployOpinion] ADD   [iItem7] int  NULL
 GO
ALTER TABLE [tblIMS_EmployOpinion] ADD   [iItem8] int  NULL
 GO
ALTER TABLE [tblIMS_EmployOpinion] ADD   [chOpinion] nvarchar(1000)  NULL
 GO

GO
ALTER TABLE [tblIMS_EmployOpinion] ADD PRIMARY KEY ([TF_Id], [iEmployId], [iUserId]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_EmployPersonal] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_EmployPersonal_TF_Id] DEFAULT ((newid()))  , 
  [iEmployId] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_EmployPersonal] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_EmployPersonal_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_EmployPersonal] ADD   [iEmployId] int  NOT NULL
 GO
ALTER TABLE [tblIMS_EmployPersonal] ADD   [iRow] int  NULL
 GO
ALTER TABLE [tblIMS_EmployPersonal] ADD   [chName] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_EmployPersonal] ADD   [chRelation] nvarchar(20)  NULL
 GO
ALTER TABLE [tblIMS_EmployPersonal] ADD   [iAge] int  NULL
 GO
ALTER TABLE [tblIMS_EmployPersonal] ADD   [chUniversityGrade] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_EmployPersonal] ADD   [chJob] nvarchar(500)  NULL
 GO

GO
ALTER TABLE [tblIMS_EmployPersonal] ADD PRIMARY KEY ([TF_Id], [iEmployId]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_EmploySchoolDoc] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_EmploySchoolDoc_TF_Id] DEFAULT ((newid()))  , 
  [iEmployId] int  NOT NULL , 
  [iRow] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_EmploySchoolDoc] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_EmploySchoolDoc_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_EmploySchoolDoc] ADD   [iEmployId] int  NOT NULL
 GO
ALTER TABLE [tblIMS_EmploySchoolDoc] ADD   [iRow] int  NOT NULL
 GO
ALTER TABLE [tblIMS_EmploySchoolDoc] ADD   [chLoc] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_EmploySchoolDoc] ADD   [chTermTitle] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_EmploySchoolDoc] ADD   [iStartDate] nvarchar(20)  NULL
 GO
ALTER TABLE [tblIMS_EmploySchoolDoc] ADD   [iEndDate] nvarchar(20)  NULL
 GO
ALTER TABLE [tblIMS_EmploySchoolDoc] ADD   [chNote] nvarchar(500)  NULL
 GO

GO
ALTER TABLE [tblIMS_EmploySchoolDoc] ADD PRIMARY KEY ([TF_Id], [iEmployId], [iRow]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_EmployWorkHistory] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_EmployWorkHistory_TF_Id] DEFAULT ((newid()))  , 
  [iEmployId] int  NOT NULL , 
  [iRow] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_EmployWorkHistory] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_EmployWorkHistory_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_EmployWorkHistory] ADD   [iEmployId] int  NOT NULL
 GO
ALTER TABLE [tblIMS_EmployWorkHistory] ADD   [iRow] int  NOT NULL
 GO
ALTER TABLE [tblIMS_EmployWorkHistory] ADD   [chWName] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_EmployWorkHistory] ADD   [chWTel] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_EmployWorkHistory] ADD   [iWType] int  NULL
 GO
ALTER TABLE [tblIMS_EmployWorkHistory] ADD   [iWTitle] int  NULL
 GO
ALTER TABLE [tblIMS_EmployWorkHistory] ADD   [iWStart] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_EmployWorkHistory] ADD   [iWEnd] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_EmployWorkHistory] ADD   [iWSalary] int  NULL
 GO
ALTER TABLE [tblIMS_EmployWorkHistory] ADD   [iWHour] int  NULL
 GO
ALTER TABLE [tblIMS_EmployWorkHistory] ADD   [chWNote] nvarchar(500)  NULL
 GO
ALTER TABLE [tblIMS_EmployWorkHistory] ADD   [iPJobTitleCd] int  NULL
 GO

GO
ALTER TABLE [tblIMS_EmployWorkHistory] ADD PRIMARY KEY ([TF_Id], [iEmployId], [iRow]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_Error] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_Error_TF_Id] DEFAULT ((newid()))  , 
  [iId] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_Error] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_Error_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_Error] ADD   [iId] int  NOT NULL
 GO
ALTER TABLE [tblIMS_Error] ADD   [iUserId] int  NULL
 GO
ALTER TABLE [tblIMS_Error] ADD   [iDate] int  NULL
 GO
ALTER TABLE [tblIMS_Error] ADD   [dDateTimeE] datetime  NULL
 GO
ALTER TABLE [tblIMS_Error] ADD   [chSystemUserName] nvarchar(400)  NULL
 GO
ALTER TABLE [tblIMS_Error] ADD   [chFunctionName] nvarchar(600)  NULL
 GO
ALTER TABLE [tblIMS_Error] ADD   [chInputData] nvarchar(2000)  NULL
 GO
ALTER TABLE [tblIMS_Error] ADD   [chSQL] nvarchar(2000)  NULL
 GO
ALTER TABLE [tblIMS_Error] ADD   [chError] nvarchar(2000)  NULL
 GO
ALTER TABLE [tblIMS_Error] ADD   [bServer] bit  NULL
 GO
ALTER TABLE [tblIMS_Error] ADD   [iState] int  NULL
 GO
ALTER TABLE [tblIMS_Error] ADD   [iProjectCd] int  NULL
 CONSTRAINT [DF_tblIMS_Error_iProjectCd] DEFAULT (((0))) 
GO
ALTER TABLE [tblIMS_Error] ADD   [bManual] bit  NULL
 CONSTRAINT [DF_tblIMS_Error_bManual] DEFAULT (((0))) 
GO
ALTER TABLE [tblIMS_Error] ADD   [chVersion] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_Error] ADD   [iNo] int  NULL
 GO

GO
ALTER TABLE [tblIMS_Error] ADD PRIMARY KEY ([TF_Id], [iId]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_FilePath] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_FilePath_TF_Id] DEFAULT ((newid()))  , 
  [chCd] nvarchar(100)  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_FilePath] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_FilePath_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_FilePath] ADD   [chCd] nvarchar(100)  NOT NULL
 GO
ALTER TABLE [tblIMS_FilePath] ADD   [chDes] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_FilePath] ADD   [iUserId] int  NULL
 GO
ALTER TABLE [tblIMS_FilePath] ADD   [iDate] int  NULL
 GO
ALTER TABLE [tblIMS_FilePath] ADD   [chColor] nvarchar(22)  NULL
 GO

GO
ALTER TABLE [tblIMS_FilePath] ADD PRIMARY KEY ([TF_Id], [chCd]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_FixCartabl] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_FixCartabl_TF_Id] DEFAULT ((newid()))  , 
  [iCd] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_FixCartabl] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_FixCartabl_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_FixCartabl] ADD   [iCd] int  NOT NULL
 GO
ALTER TABLE [tblIMS_FixCartabl] ADD   [chPName] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_FixCartabl] ADD   [chEName] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_FixCartabl] ADD   [chNote] nvarchar(400)  NULL
 GO
ALTER TABLE [tblIMS_FixCartabl] ADD   [chColumn1] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_FixCartabl] ADD   [chColumn1Note] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_FixCartabl] ADD   [chColumn2] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_FixCartabl] ADD   [chColumn2Note] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_FixCartabl] ADD   [chColumn3] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_FixCartabl] ADD   [chColumn3Note] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_FixCartabl] ADD   [bActive] bit  NULL
 GO

GO
ALTER TABLE [tblIMS_FixCartabl] ADD PRIMARY KEY ([TF_Id], [iCd]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_FixCType] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_FixCType_TF_Id] DEFAULT ((newid()))  , 
  [iCd] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_FixCType] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_FixCType_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_FixCType] ADD   [iCd] int  NOT NULL
 GO
ALTER TABLE [tblIMS_FixCType] ADD   [chDes] nvarchar(100)  NULL
 GO

GO
ALTER TABLE [tblIMS_FixCType] ADD PRIMARY KEY ([TF_Id], [iCd]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_FixQ] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_FixQ_TF_Id] DEFAULT ((newid()))  , 
  [iQ] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_FixQ] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_FixQ_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_FixQ] ADD   [iQ] int  NOT NULL
 GO
ALTER TABLE [tblIMS_FixQ] ADD   [chDes] nvarchar(40)  NULL
 GO

GO
ALTER TABLE [tblIMS_FixQ] ADD PRIMARY KEY ([TF_Id], [iQ]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_FixMonth] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_FixMonth_TF_Id] DEFAULT ((newid()))  , 
  [iCd] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_FixMonth] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_FixMonth_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_FixMonth] ADD   [iCd] int  NOT NULL
 GO
ALTER TABLE [tblIMS_FixMonth] ADD   [chDes] nvarchar(40)  NULL
 GO

GO
ALTER TABLE [tblIMS_FixMonth] ADD PRIMARY KEY ([TF_Id], [iCd]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_FixWeekDay] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_FixWeekDay_TF_Id] DEFAULT ((newid()))  , 
  [iCd] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_FixWeekDay] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_FixWeekDay_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_FixWeekDay] ADD   [iCd] int  NOT NULL
 GO
ALTER TABLE [tblIMS_FixWeekDay] ADD   [chDes] nvarchar(20)  NULL
 GO

GO
ALTER TABLE [tblIMS_FixWeekDay] ADD PRIMARY KEY ([TF_Id], [iCd]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_Gratuity] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_Gratuity_TF_Id] DEFAULT ((newid()))  , 
  [iCd] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_Gratuity] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_Gratuity_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_Gratuity] ADD   [iCd] int  NOT NULL
 GO
ALTER TABLE [tblIMS_Gratuity] ADD   [chDes] nvarchar(100)  NULL
 GO

GO
ALTER TABLE [tblIMS_Gratuity] ADD PRIMARY KEY ([TF_Id], [iCd]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_GroupComponentProduct] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_GroupComponentProduct_TF_Id] DEFAULT ((newid()))  , 
  [iId] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_GroupComponentProduct] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_GroupComponentProduct_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_GroupComponentProduct] ADD   [iId] int  NOT NULL
 GO
ALTER TABLE [tblIMS_GroupComponentProduct] ADD   [chName] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_GroupComponentProduct] ADD   [iParentId] int  NULL
 GO
ALTER TABLE [tblIMS_GroupComponentProduct] ADD   [iType] int  NULL
 GO
ALTER TABLE [tblIMS_GroupComponentProduct] ADD   [bActive] bit  NULL
 GO
ALTER TABLE [tblIMS_GroupComponentProduct] ADD   [iGTime] int  NULL
 GO
ALTER TABLE [tblIMS_GroupComponentProduct] ADD   [iPrice] int  NULL
 GO
ALTER TABLE [tblIMS_GroupComponentProduct] ADD   [iDiscount] int  NULL
 GO
ALTER TABLE [tblIMS_GroupComponentProduct] ADD   [chDes] text  NULL
 GO
ALTER TABLE [tblIMS_GroupComponentProduct] ADD   [chNote] text  NULL
 GO
ALTER TABLE [tblIMS_GroupComponentProduct] ADD   [bService] bit  NULL
 GO
ALTER TABLE [tblIMS_GroupComponentProduct] ADD   [bWebShow] bit  NULL
 CONSTRAINT [DF_tblIMS_GroupComponentProduct_bWebShow] DEFAULT (((0))) 
GO
ALTER TABLE [tblIMS_GroupComponentProduct] ADD   [chPic1] nvarchar(200)  NULL
 GO
ALTER TABLE [tblIMS_GroupComponentProduct] ADD   [chPic2] nvarchar(200)  NULL
 GO
ALTER TABLE [tblIMS_GroupComponentProduct] ADD   [iTreeId] int  NULL
 GO
ALTER TABLE [tblIMS_GroupComponentProduct] ADD   [DollarPrice] int  NOT NULL
 CONSTRAINT [DF_tblIMS_GroupComponentProduct_DollarPrice] DEFAULT ((10000)) 
GO
ALTER TABLE [tblIMS_GroupComponentProduct] ADD   [ProductPriceInDollar] int  NULL
 GO

GO
ALTER TABLE [tblIMS_GroupComponentProduct] ADD PRIMARY KEY ([TF_Id], [iId]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_Groups] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_Groups_TF_Id] DEFAULT ((newid()))  , 
  [Id] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_Groups] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_Groups_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_Groups] ADD   [Id] int  NOT NULL
 GO
ALTER TABLE [tblIMS_Groups] ADD   [Code] int  NULL
 GO
ALTER TABLE [tblIMS_Groups] ADD   [Name] nvarchar(1000)  NULL
 GO
ALTER TABLE [tblIMS_Groups] ADD   [ParentCode] int  NULL
 GO

GO
ALTER TABLE [tblIMS_Groups] ADD PRIMARY KEY ([TF_Id], [Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_History] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_History_TF_Id] DEFAULT ((newid()))  , 
  [iId] bigint IDENTITY(1,1) NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_History] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_History_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_History] ADD   [iId] bigint IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [tblIMS_History] ADD   [iUserId] int  NULL
 GO
ALTER TABLE [tblIMS_History] ADD   [iDate] int  NULL
 GO
ALTER TABLE [tblIMS_History] ADD   [dDateTimeE] datetime  NULL
 GO
ALTER TABLE [tblIMS_History] ADD   [chSystemUserName] nvarchar(200)  NULL
 GO
ALTER TABLE [tblIMS_History] ADD   [chFunctionName] nvarchar(200)  NULL
 GO
ALTER TABLE [tblIMS_History] ADD   [chInputData] nvarchar(1000)  NULL
 GO
ALTER TABLE [tblIMS_History] ADD   [chSQL] nvarchar(1000)  NULL
 GO
ALTER TABLE [tblIMS_History] ADD   [chError] nvarchar(1000)  NULL
 GO
ALTER TABLE [tblIMS_History] ADD   [chVersion] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_History] ADD   [iState] smallint  NULL
 GO
ALTER TABLE [tblIMS_History] ADD   [iProjectCd] int  NULL
 GO
ALTER TABLE [tblIMS_History] ADD   [bServer] bit  NULL
 GO

GO
ALTER TABLE [tblIMS_History] ADD PRIMARY KEY ([TF_Id], [iId]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_Holiday] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_Holiday_TF_Id] DEFAULT ((newid()))  , 
  [iId] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_Holiday] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_Holiday_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_Holiday] ADD   [iId] int  NOT NULL
 GO
ALTER TABLE [tblIMS_Holiday] ADD   [bFix] bit  NULL
 GO
ALTER TABLE [tblIMS_Holiday] ADD   [iUserId] int  NULL
 GO
ALTER TABLE [tblIMS_Holiday] ADD   [iDate] int  NULL
 GO
ALTER TABLE [tblIMS_Holiday] ADD   [chDate] nvarchar(20)  NULL
 GO
ALTER TABLE [tblIMS_Holiday] ADD   [chMDate] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_Holiday] ADD   [iYear] int  NULL
 GO
ALTER TABLE [tblIMS_Holiday] ADD   [chDes] nvarchar(2000)  NULL
 GO
ALTER TABLE [tblIMS_Holiday] ADD   [chSMS] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_Holiday] ADD   [bHoliday] bit  NULL
 CONSTRAINT [DF_tblIMS_Holiday_bHoliday] DEFAULT (((0))) 
GO

GO
ALTER TABLE [tblIMS_Holiday] ADD PRIMARY KEY ([TF_Id], [iId]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_InternalTel] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_InternalTel_TF_Id] DEFAULT ((newid()))  , 
  [iId] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_InternalTel] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_InternalTel_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_InternalTel] ADD   [iId] int  NOT NULL
 GO
ALTER TABLE [tblIMS_InternalTel] ADD   [chTel] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_InternalTel] ADD   [chName] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_InternalTel] ADD   [iCompanyBuildingCd] int  NULL
 GO

GO
ALTER TABLE [tblIMS_InternalTel] ADD PRIMARY KEY ([TF_Id], [iId]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_Inventory] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_Inventory_TF_Id] DEFAULT ((newid()))  , 
  [iCd] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_Inventory] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_Inventory_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_Inventory] ADD   [iCd] int  NOT NULL
 GO
ALTER TABLE [tblIMS_Inventory] ADD   [chDes] nvarchar(200)  NULL
 GO

GO
ALTER TABLE [tblIMS_Inventory] ADD PRIMARY KEY ([TF_Id], [iCd]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_Log] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_Log_TF_Id] DEFAULT ((newid()))  , 
  [iId] int IDENTITY(1,1) NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_Log] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_Log_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_Log] ADD   [iId] int IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [tblIMS_Log] ADD   [chDay] nvarchar(18)  NULL
 GO
ALTER TABLE [tblIMS_Log] ADD   [chDate] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_Log] ADD   [chTime] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_Log] ADD   [dDateTimeE] datetime  NULL
 GO
ALTER TABLE [tblIMS_Log] ADD   [chSystemUserName] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_Log] ADD   [iUserId] int  NULL
 GO
ALTER TABLE [tblIMS_Log] ADD   [chFormName] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_Log] ADD   [chMode] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_Log] ADD   [chQuery] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_Log] ADD   [chUserName] nvarchar(100)  NULL
 GO

GO
ALTER TABLE [tblIMS_Log] ADD PRIMARY KEY ([TF_Id], [iId]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_Meeting] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_Meeting_TF_Id] DEFAULT ((newid()))  , 
  [iId] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_Meeting] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_Meeting_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_Meeting] ADD   [iId] int  NOT NULL
 GO
ALTER TABLE [tblIMS_Meeting] ADD   [iPId] int  NULL
 GO
ALTER TABLE [tblIMS_Meeting] ADD   [chDay] nvarchar(18)  NULL
 GO
ALTER TABLE [tblIMS_Meeting] ADD   [chDate] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_Meeting] ADD   [chIn] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_Meeting] ADD   [chOut] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_Meeting] ADD   [chDef] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_Meeting] ADD   [chName] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_Meeting] ADD   [chCompany] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_Meeting] ADD   [chSubject] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_Meeting] ADD   [chDes] text  NULL
 GO
ALTER TABLE [tblIMS_Meeting] ADD   [iUserId] int  NULL
 GO
ALTER TABLE [tblIMS_Meeting] ADD   [iDate] int  NULL
 GO
ALTER TABLE [tblIMS_Meeting] ADD   [bDelete] bit  NULL
 GO

GO
ALTER TABLE [tblIMS_Meeting] ADD PRIMARY KEY ([TF_Id], [iId]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_NoteBook] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_NoteBook_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_NoteBook] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_NoteBook_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_NoteBook] ADD   [chCd] nvarchar(50)  NULL
 GO
ALTER TABLE [tblIMS_NoteBook] ADD   [chDes] text  NULL
 GO
ALTER TABLE [tblIMS_NoteBook] ADD   [iUserId] int  NULL
 GO
ALTER TABLE [tblIMS_NoteBook] ADD   [iDate] int  NULL
 GO
ALTER TABLE [tblIMS_NoteBook] ADD   [chColor] nvarchar(11)  NULL
 GO

GO
ALTER TABLE [tblIMS_NoteBook] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_Options] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_Options_TF_Id] DEFAULT ((newid()))  , 
  [iId] int IDENTITY(1,1) NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_Options] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_Options_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_Options] ADD   [iId] int IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [tblIMS_Options] ADD   [iUserId] int  NULL
 GO
ALTER TABLE [tblIMS_Options] ADD   [iQDateNoCT0] int  NULL
 GO
ALTER TABLE [tblIMS_Options] ADD   [iQDateNoCT1] int  NULL
 GO
ALTER TABLE [tblIMS_Options] ADD   [iQDateNoCT2] int  NULL
 GO
ALTER TABLE [tblIMS_Options] ADD   [iQDateNoCT3] int  NULL
 GO
ALTER TABLE [tblIMS_Options] ADD   [iQDateNoPerson] int  NULL
 GO
ALTER TABLE [tblIMS_Options] ADD   [iMaxQNo] int  NULL
 GO
ALTER TABLE [tblIMS_Options] ADD   [iQTransactionDateNo] int  NULL
 GO
ALTER TABLE [tblIMS_Options] ADD   [iDate] int  NULL
 GO
ALTER TABLE [tblIMS_Options] ADD   [sQAdminUserId] nvarchar(510)  NULL
 GO
ALTER TABLE [tblIMS_Options] ADD   [chDate] nvarchar(18)  NULL
 GO
ALTER TABLE [tblIMS_Options] ADD   [chLate] nvarchar(10)  NULL
 GO
ALTER TABLE [tblIMS_Options] ADD   [iLateNo] int  NULL
 GO
ALTER TABLE [tblIMS_Options] ADD   [chEnd] nvarchar(10)  NULL
 GO
ALTER TABLE [tblIMS_Options] ADD   [chParticular] nvarchar(10)  NULL
 GO
ALTER TABLE [tblIMS_Options] ADD   [iKartSub] int  NULL
 GO
ALTER TABLE [tblIMS_Options] ADD   [iLateSub] int  NULL
 GO
ALTER TABLE [tblIMS_Options] ADD   [iWorkRepSub] int  NULL
 GO
ALTER TABLE [tblIMS_Options] ADD   [iWorkHour] int  NULL
 GO
ALTER TABLE [tblIMS_Options] ADD   [iWorkHourSub] int  NULL
 GO
ALTER TABLE [tblIMS_Options] ADD   [iInsuranceHour] int  NULL
 GO
ALTER TABLE [tblIMS_Options] ADD   [iInsuranceSub] int  NULL
 GO
ALTER TABLE [tblIMS_Options] ADD   [iInsurancePrice] int  NULL
 GO
ALTER TABLE [tblIMS_Options] ADD   [iMaxFixQNo] int  NULL
 GO

GO
ALTER TABLE [tblIMS_Options] ADD PRIMARY KEY ([TF_Id], [iId]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_Personnel] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_Personnel_TF_Id] DEFAULT ((newid()))  , 
  [iUserId] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_Personnel] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_Personnel_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_Personnel] ADD   [iUserId] int  NOT NULL
 GO
ALTER TABLE [tblIMS_Personnel] ADD   [chDadName] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_Personnel] ADD   [chShNo] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_Personnel] ADD   [chMeliCd] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_Personnel] ADD   [iBirthDate] int  NULL
 GO
ALTER TABLE [tblIMS_Personnel] ADD   [chUserName] nvarchar(MAX)  NULL
 GO
ALTER TABLE [tblIMS_Personnel] ADD   [iCompanyUnitCd] int  NULL
 GO
ALTER TABLE [tblIMS_Personnel] ADD   [bActive] bit  NULL
 GO
ALTER TABLE [tblIMS_Personnel] ADD   [chAccessForms] nvarchar(2000)  NULL
 GO
ALTER TABLE [tblIMS_Personnel] ADD   [iStartWDate] int  NULL
 GO
ALTER TABLE [tblIMS_Personnel] ADD   [iEndWDate] int  NULL
 GO
ALTER TABLE [tblIMS_Personnel] ADD   [iPNo] int  NULL
 GO
ALTER TABLE [tblIMS_Personnel] ADD   [iEmployId] int  NULL
 GO
ALTER TABLE [tblIMS_Personnel] ADD   [iKartNo] int  NULL
 CONSTRAINT [DF_tblIMS_Personnel_iKartNo] DEFAULT ((0)) 
GO
ALTER TABLE [tblIMS_Personnel] ADD   [chBime] nvarchar(40)  NULL
 GO
ALTER TABLE [tblIMS_Personnel] ADD   [iBimeDate] int  NULL
 GO
ALTER TABLE [tblIMS_Personnel] ADD   [iEmploy] int  NULL
 GO
ALTER TABLE [tblIMS_Personnel] ADD   [bEmploy] bit  NULL
 GO
ALTER TABLE [tblIMS_Personnel] ADD   [chUserPas] nvarchar(50)  NULL
 GO
ALTER TABLE [tblIMS_Personnel] ADD   [bOn] bit  NULL
 CONSTRAINT [DF_tblIMS_Personnel_bOn] DEFAULT (((0))) 
GO
ALTER TABLE [tblIMS_Personnel] ADD   [iFixQNo] int  NULL
 CONSTRAINT [DF_tblIMS_Personnel_iFixQNo] DEFAULT (((0))) 
GO
ALTER TABLE [tblIMS_Personnel] ADD   [bFullAccess] bit  NULL
 CONSTRAINT [DF_tblIMS_Personnel_bFullAccess] DEFAULT (((0))) 
GO
ALTER TABLE [tblIMS_Personnel] ADD   [chPic] nvarchar(200)  NULL
 GO
ALTER TABLE [tblIMS_Personnel] ADD   [chAccountNo] nvarchar(60)  NULL
 GO
ALTER TABLE [tblIMS_Personnel] ADD   [chIP] nvarchar(12)  NULL
 GO
ALTER TABLE [tblIMS_Personnel] ADD   [chPas] nvarchar(400)  NULL
 GO

GO
ALTER TABLE [tblIMS_Personnel] ADD PRIMARY KEY ([TF_Id], [iUserId]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_PersonnelAccess] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_PersonnelAccess_TF_Id] DEFAULT ((newid()))  , 
  [iUserId] int  NOT NULL , 
  [iRow] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_PersonnelAccess] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_PersonnelAccess_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_PersonnelAccess] ADD   [iUserId] int  NOT NULL
 GO
ALTER TABLE [tblIMS_PersonnelAccess] ADD   [iRow] int  NOT NULL
 GO
ALTER TABLE [tblIMS_PersonnelAccess] ADD   [iFormId] int  NULL
 GO
ALTER TABLE [tblIMS_PersonnelAccess] ADD   [iAccessType] int  NULL
 GO

GO
ALTER TABLE [tblIMS_PersonnelAccess] ADD PRIMARY KEY ([TF_Id], [iUserId], [iRow]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_PersonnelCartablAccess] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_PersonnelCartablAccess_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_PersonnelCartablAccess] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_PersonnelCartablAccess_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_PersonnelCartablAccess] ADD   [iUserId] int  NULL
 GO
ALTER TABLE [tblIMS_PersonnelCartablAccess] ADD   [iCartablId] int  NULL
 GO
ALTER TABLE [tblIMS_PersonnelCartablAccess] ADD   [iAccessType] tinyint  NULL
 GO

GO
ALTER TABLE [tblIMS_PersonnelCartablAccess] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_PersonnelDes] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_PersonnelDes_TF_Id] DEFAULT ((newid()))  , 
  [iId] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_PersonnelDes] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_PersonnelDes_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_PersonnelDes] ADD   [iId] int  NOT NULL
 GO
ALTER TABLE [tblIMS_PersonnelDes] ADD   [iUserId] int  NULL
 GO
ALTER TABLE [tblIMS_PersonnelDes] ADD   [chDay] nvarchar(18)  NULL
 GO
ALTER TABLE [tblIMS_PersonnelDes] ADD   [iDate] int  NULL
 GO
ALTER TABLE [tblIMS_PersonnelDes] ADD   [chDes] text  NULL
 GO

GO
ALTER TABLE [tblIMS_PersonnelDes] ADD PRIMARY KEY ([TF_Id], [iId]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_PersonnelInternalTel] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_PersonnelInternalTel_TF_Id] DEFAULT ((newid()))  , 
  [iId] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_PersonnelInternalTel] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_PersonnelInternalTel_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_PersonnelInternalTel] ADD   [iId] int  NOT NULL
 GO
ALTER TABLE [tblIMS_PersonnelInternalTel] ADD   [chTel] nvarchar(40)  NULL
 GO
ALTER TABLE [tblIMS_PersonnelInternalTel] ADD   [iUserId] int  NULL
 GO
ALTER TABLE [tblIMS_PersonnelInternalTel] ADD   [iCompanyBuildingCd] int  NULL
 GO

GO
ALTER TABLE [tblIMS_PersonnelInternalTel] ADD PRIMARY KEY ([TF_Id], [iId]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_PersonnelManagerDes] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_PersonnelManagerDes_TF_Id] DEFAULT ((newid()))  , 
  [chCd] nvarchar(50)  NOT NULL , 
  [iUserId] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_PersonnelManagerDes] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_PersonnelManagerDes_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_PersonnelManagerDes] ADD   [chCd] nvarchar(50)  NOT NULL
 GO
ALTER TABLE [tblIMS_PersonnelManagerDes] ADD   [chDes] text  NULL
 GO
ALTER TABLE [tblIMS_PersonnelManagerDes] ADD   [iUserId] int  NOT NULL
 GO
ALTER TABLE [tblIMS_PersonnelManagerDes] ADD   [iDate] int  NULL
 GO
ALTER TABLE [tblIMS_PersonnelManagerDes] ADD   [chColor] nvarchar(11)  NULL
 CONSTRAINT [DF_tblIMS_PersonnelManagerDes_chColor] DEFAULT ((0)) 
GO

GO
ALTER TABLE [tblIMS_PersonnelManagerDes] ADD PRIMARY KEY ([TF_Id], [chCd], [iUserId]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_PersonnelSalary] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_PersonnelSalary_TF_Id] DEFAULT ((newid()))  , 
  [iId] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_PersonnelSalary] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_PersonnelSalary_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_PersonnelSalary] ADD   [iId] int  NOT NULL
 GO
ALTER TABLE [tblIMS_PersonnelSalary] ADD   [iUserId] int  NULL
 GO
ALTER TABLE [tblIMS_PersonnelSalary] ADD   [chDay] nvarchar(18)  NULL
 GO
ALTER TABLE [tblIMS_PersonnelSalary] ADD   [iDate] int  NULL
 GO
ALTER TABLE [tblIMS_PersonnelSalary] ADD   [iFix] int  NULL
 GO
ALTER TABLE [tblIMS_PersonnelSalary] ADD   [iHour] int  NULL
 GO
ALTER TABLE [tblIMS_PersonnelSalary] ADD   [iIncreaseHour] int  NULL
 GO
ALTER TABLE [tblIMS_PersonnelSalary] ADD   [iByLawGeneral] int  NULL
 GO
ALTER TABLE [tblIMS_PersonnelSalary] ADD   [iByLawUnit] int  NULL
 GO
ALTER TABLE [tblIMS_PersonnelSalary] ADD   [bInsurance] bit  NULL
 GO
ALTER TABLE [tblIMS_PersonnelSalary] ADD   [bBenefit] bit  NULL
 GO
ALTER TABLE [tblIMS_PersonnelSalary] ADD   [chDes] text  NULL
 GO

GO
ALTER TABLE [tblIMS_PersonnelSalary] ADD PRIMARY KEY ([TF_Id], [iId]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_PersonnelStrap] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_PersonnelStrap_TF_Id] DEFAULT ((newid()))  , 
  [iId] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_PersonnelStrap] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_PersonnelStrap_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_PersonnelStrap] ADD   [iId] int  NOT NULL
 GO
ALTER TABLE [tblIMS_PersonnelStrap] ADD   [iUserId] int  NULL
 GO
ALTER TABLE [tblIMS_PersonnelStrap] ADD   [iYear] int  NULL
 GO
ALTER TABLE [tblIMS_PersonnelStrap] ADD   [iMonth] int  NULL
 GO
ALTER TABLE [tblIMS_PersonnelStrap] ADD   [iWorkDateNo] int  NULL
 GO
ALTER TABLE [tblIMS_PersonnelStrap] ADD   [iHourPrice] int  NULL
 GO
ALTER TABLE [tblIMS_PersonnelStrap] ADD   [iHourSum] float  NULL
 GO
ALTER TABLE [tblIMS_PersonnelStrap] ADD   [iBaseSalary] int  NULL
 GO
ALTER TABLE [tblIMS_PersonnelStrap] ADD   [iPersonnelSalaryId] int  NULL
 GO
ALTER TABLE [tblIMS_PersonnelStrap] ADD   [iSalary] int  NULL
 GO
ALTER TABLE [tblIMS_PersonnelStrap] ADD   [chStart] nvarchar(10)  NULL
 GO
ALTER TABLE [tblIMS_PersonnelStrap] ADD   [chEnd] nvarchar(10)  NULL
 GO
ALTER TABLE [tblIMS_PersonnelStrap] ADD   [iDate] int  NULL
 GO
ALTER TABLE [tblIMS_PersonnelStrap] ADD   [chDes] nvarchar(400)  NULL
 GO
ALTER TABLE [tblIMS_PersonnelStrap] ADD   [bAccHidden] bit  NULL
 CONSTRAINT [DF_tblIMS_PersonnelStrap_bAccHidden] DEFAULT (((0))) 
GO
ALTER TABLE [tblIMS_PersonnelStrap] ADD   [iLateOkNo] int  NULL
 CONSTRAINT [DF_tblIMS_PersonnelStrap_iLateOkNo] DEFAULT (((0))) 
GO
ALTER TABLE [tblIMS_PersonnelStrap] ADD   [iLateNo] int  NULL
 CONSTRAINT [DF_tblIMS_PersonnelStrap_iLateNo] DEFAULT (((0))) 
GO
ALTER TABLE [tblIMS_PersonnelStrap] ADD   [iEndOkNo] int  NULL
 CONSTRAINT [DF_tblIMS_PersonnelStrap_iEndOkNo] DEFAULT (((0))) 
GO
ALTER TABLE [tblIMS_PersonnelStrap] ADD   [iEndNo] int  NULL
 CONSTRAINT [DF_tblIMS_PersonnelStrap_iEndNo] DEFAULT (((0))) 
GO
ALTER TABLE [tblIMS_PersonnelStrap] ADD   [iDailyWorkOkNo] int  NULL
 CONSTRAINT [DF_tblIMS_PersonnelStrap_iDailyWorkOkNo] DEFAULT (((0))) 
GO
ALTER TABLE [tblIMS_PersonnelStrap] ADD   [iDailyWorkNo] int  NULL
 CONSTRAINT [DF_tblIMS_PersonnelStrap_iDailyWorkNo] DEFAULT (((0))) 
GO
ALTER TABLE [tblIMS_PersonnelStrap] ADD   [iKartOkNo] int  NULL
 CONSTRAINT [DF_tblIMS_PersonnelStrap_iKartOkNo] DEFAULT (((0))) 
GO
ALTER TABLE [tblIMS_PersonnelStrap] ADD   [iKartNo] int  NULL
 CONSTRAINT [DF_tblIMS_PersonnelStrap_iKartNo] DEFAULT (((0))) 
GO
ALTER TABLE [tblIMS_PersonnelStrap] ADD   [iParticularDayNo] int  NULL
 CONSTRAINT [DF_tblIMS_PersonnelStrap_iParticularDayNo] DEFAULT (((0))) 
GO
ALTER TABLE [tblIMS_PersonnelStrap] ADD   [iIncreaseHour] int  NOT NULL
 CONSTRAINT [DF_tblIMS_PersonnelStrap_iIncreaseHour] DEFAULT (((0))) 
GO
ALTER TABLE [tblIMS_PersonnelStrap] ADD   [iEidi] int  NULL
 GO

GO
ALTER TABLE [tblIMS_PersonnelStrap] ADD PRIMARY KEY ([TF_Id], [iId]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_PersonnelStrapGratuity] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_PersonnelStrapGratuity_TF_Id] DEFAULT ((newid()))  , 
  [iPersonnelStrapId] int  NOT NULL , 
  [iRow] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_PersonnelStrapGratuity] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_PersonnelStrapGratuity_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_PersonnelStrapGratuity] ADD   [iPersonnelStrapId] int  NOT NULL
 GO
ALTER TABLE [tblIMS_PersonnelStrapGratuity] ADD   [iRow] int  NOT NULL
 GO
ALTER TABLE [tblIMS_PersonnelStrapGratuity] ADD   [bAdd] bit  NULL
 GO
ALTER TABLE [tblIMS_PersonnelStrapGratuity] ADD   [chDes] nvarchar(1000)  NULL
 GO
ALTER TABLE [tblIMS_PersonnelStrapGratuity] ADD   [iPrice] int  NULL
 GO
ALTER TABLE [tblIMS_PersonnelStrapGratuity] ADD   [iGratuityCd] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_PersonnelStrapGratuity] ADD   [iNo] int  NULL
 GO

GO
ALTER TABLE [tblIMS_PersonnelStrapGratuity] ADD PRIMARY KEY ([TF_Id], [iPersonnelStrapId], [iRow]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_PersonnelStrapGratuityManual] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_PersonnelStrapGratuityManual_TF_Id] DEFAULT ((newid()))  , 
  [iId] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_PersonnelStrapGratuityManual] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_PersonnelStrapGratuityManual_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_PersonnelStrapGratuityManual] ADD   [iId] int  NOT NULL
 GO
ALTER TABLE [tblIMS_PersonnelStrapGratuityManual] ADD   [iPId] int  NULL
 GO
ALTER TABLE [tblIMS_PersonnelStrapGratuityManual] ADD   [iYear] int  NULL
 GO
ALTER TABLE [tblIMS_PersonnelStrapGratuityManual] ADD   [iMonth] int  NULL
 GO
ALTER TABLE [tblIMS_PersonnelStrapGratuityManual] ADD   [bAdd] bit  NULL
 GO
ALTER TABLE [tblIMS_PersonnelStrapGratuityManual] ADD   [chDes] nvarchar(1000)  NULL
 GO
ALTER TABLE [tblIMS_PersonnelStrapGratuityManual] ADD   [iPrice] int  NULL
 GO
ALTER TABLE [tblIMS_PersonnelStrapGratuityManual] ADD   [bAccHidden] bit  NULL
 GO

GO
ALTER TABLE [tblIMS_PersonnelStrapGratuityManual] ADD PRIMARY KEY ([TF_Id], [iId]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_PersonnelTime] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_PersonnelTime_TF_Id] DEFAULT ((newid()))  , 
  [iId] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_PersonnelTime] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_PersonnelTime_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_PersonnelTime] ADD   [iId] int  NOT NULL
 GO
ALTER TABLE [tblIMS_PersonnelTime] ADD   [iKartNo] int  NULL
 GO
ALTER TABLE [tblIMS_PersonnelTime] ADD   [iDay] tinyint  NULL
 GO
ALTER TABLE [tblIMS_PersonnelTime] ADD   [chDateOld] nvarchar(20)  NULL
 GO
ALTER TABLE [tblIMS_PersonnelTime] ADD   [chDate] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_PersonnelTime] ADD   [chInOld] nvarchar(10)  NULL
 GO
ALTER TABLE [tblIMS_PersonnelTime] ADD   [chIn] nvarchar(10)  NULL
 GO
ALTER TABLE [tblIMS_PersonnelTime] ADD   [chOutOld] nvarchar(10)  NULL
 GO
ALTER TABLE [tblIMS_PersonnelTime] ADD   [chOut] nvarchar(10)  NULL
 GO
ALTER TABLE [tblIMS_PersonnelTime] ADD   [chDef] nvarchar(10)  NULL
 GO
ALTER TABLE [tblIMS_PersonnelTime] ADD   [chDes] text  NULL
 GO
ALTER TABLE [tblIMS_PersonnelTime] ADD   [bLateOk] bit  NULL
 GO
ALTER TABLE [tblIMS_PersonnelTime] ADD   [bInKartOk] bit  NULL
 GO
ALTER TABLE [tblIMS_PersonnelTime] ADD   [bOutKartOk] bit  NULL
 GO
ALTER TABLE [tblIMS_PersonnelTime] ADD   [bEndOk] bit  NULL
 GO
ALTER TABLE [tblIMS_PersonnelTime] ADD   [bDailyWorkOk] bit  NULL
 GO
ALTER TABLE [tblIMS_PersonnelTime] ADD   [bParticularDay] bit  NULL
 GO
ALTER TABLE [tblIMS_PersonnelTime] ADD   [iDeviceNo] int  NULL
 GO

GO
ALTER TABLE [tblIMS_PersonnelTime] ADD PRIMARY KEY ([TF_Id], [iId]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_PJobTitle] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_PJobTitle_TF_Id] DEFAULT ((newid()))  , 
  [iCd] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_PJobTitle] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_PJobTitle_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_PJobTitle] ADD   [iCd] int  NOT NULL
 GO
ALTER TABLE [tblIMS_PJobTitle] ADD   [chDes] nvarchar(200)  NULL
 GO

GO
ALTER TABLE [tblIMS_PJobTitle] ADD PRIMARY KEY ([TF_Id], [iCd]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_ProductCode] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_ProductCode_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_ProductCode] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_ProductCode_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_ProductCode] ADD   [ProductPointer] int  NULL
 GO
ALTER TABLE [tblIMS_ProductCode] ADD   [ProductCode] nchar(10)  NULL
 GO
ALTER TABLE [tblIMS_ProductCode] ADD   [Number] int  NOT NULL
 CONSTRAINT [DF_tblIMS_ProductCode_Number] DEFAULT ((1)) 
GO

GO
ALTER TABLE [tblIMS_ProductCode] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_ProductComponentR] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_ProductComponentR_TF_Id] DEFAULT ((newid()))  , 
  [iId] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_ProductComponentR] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_ProductComponentR_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_ProductComponentR] ADD   [iId] int  NOT NULL
 GO
ALTER TABLE [tblIMS_ProductComponentR] ADD   [iProductId] int  NULL
 GO
ALTER TABLE [tblIMS_ProductComponentR] ADD   [iComponentId] int  NULL
 GO
ALTER TABLE [tblIMS_ProductComponentR] ADD   [iCount] int  NULL
 GO

GO
ALTER TABLE [tblIMS_ProductComponentR] ADD PRIMARY KEY ([TF_Id], [iId]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_Project] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_Project_TF_Id] DEFAULT ((newid()))  , 
  [iCd] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_Project] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_Project_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_Project] ADD   [iCd] int  NOT NULL
 GO
ALTER TABLE [tblIMS_Project] ADD   [chDes] nvarchar(200)  NULL
 GO

GO
ALTER TABLE [tblIMS_Project] ADD PRIMARY KEY ([TF_Id], [iCd]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_Province] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_Province_TF_Id] DEFAULT ((newid()))  , 
  [iCd] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_Province] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_Province_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_Province] ADD   [iCd] int  NOT NULL
 GO
ALTER TABLE [tblIMS_Province] ADD   [chDes] nvarchar(200)  NULL
 GO

GO
ALTER TABLE [tblIMS_Province] ADD PRIMARY KEY ([TF_Id], [iCd]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_ProvinceCity] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_ProvinceCity_TF_Id] DEFAULT ((newid()))  , 
  [iId] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_ProvinceCity] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_ProvinceCity_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_ProvinceCity] ADD   [iId] int  NOT NULL
 GO
ALTER TABLE [tblIMS_ProvinceCity] ADD   [iMumCd] int  NULL
 GO
ALTER TABLE [tblIMS_ProvinceCity] ADD   [chTelCd] nvarchar(20)  NULL
 GO
ALTER TABLE [tblIMS_ProvinceCity] ADD   [chDes] nvarchar(200)  NULL
 GO

GO
ALTER TABLE [tblIMS_ProvinceCity] ADD PRIMARY KEY ([TF_Id], [iId]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_Quarantine] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_Quarantine_TF_Id] DEFAULT ((newid()))  , 
  [iId] int IDENTITY(1,1) NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_Quarantine] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_Quarantine_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_Quarantine] ADD   [iId] int IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [tblIMS_Quarantine] ADD   [iUserId] int  NULL
 GO
ALTER TABLE [tblIMS_Quarantine] ADD   [iCPId] int  NULL
 GO
ALTER TABLE [tblIMS_Quarantine] ADD   [iPId] int  NULL
 GO
ALTER TABLE [tblIMS_Quarantine] ADD   [dStartDateE] datetime  NULL
 GO
ALTER TABLE [tblIMS_Quarantine] ADD   [dEndDateE] datetime  NULL
 GO
ALTER TABLE [tblIMS_Quarantine] ADD   [iDateNoBase] int  NULL
 GO
ALTER TABLE [tblIMS_Quarantine] ADD   [iDateNo] int  NULL
 GO
ALTER TABLE [tblIMS_Quarantine] ADD   [iStartDateP] int  NULL
 GO
ALTER TABLE [tblIMS_Quarantine] ADD   [iEndDateP] int  NULL
 GO
ALTER TABLE [tblIMS_Quarantine] ADD   [iPIdReserve] int  NULL
 GO
ALTER TABLE [tblIMS_Quarantine] ADD   [iQ] int  NULL
 GO
ALTER TABLE [tblIMS_Quarantine] ADD   [iDate] int  NULL
 GO

GO
ALTER TABLE [tblIMS_Quarantine] ADD PRIMARY KEY ([TF_Id], [iId]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_Records] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_Records_TF_Id] DEFAULT ((newid()))  , 
  [iId] bigint  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_Records] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_Records_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_Records] ADD   [iId] bigint  NOT NULL
 GO
ALTER TABLE [tblIMS_Records] ADD   [chName] nvarchar(600)  NULL
 GO
ALTER TABLE [tblIMS_Records] ADD   [TM] nvarchar(200)  NULL
 GO
ALTER TABLE [tblIMS_Records] ADD   [chAddress] nvarchar(1000)  NULL
 GO
ALTER TABLE [tblIMS_Records] ADD   [City] nvarchar(400)  NULL
 GO
ALTER TABLE [tblIMS_Records] ADD   [iCityCd] int  NULL
 GO
ALTER TABLE [tblIMS_Records] ADD   [Tel] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_Records] ADD   [Fax] nvarchar(400)  NULL
 GO
ALTER TABLE [tblIMS_Records] ADD   [Email] nvarchar(400)  NULL
 GO
ALTER TABLE [tblIMS_Records] ADD   [WebSite] nvarchar(400)  NULL
 GO
ALTER TABLE [tblIMS_Records] ADD   [ZipCode] nvarchar(400)  NULL
 GO
ALTER TABLE [tblIMS_Records] ADD   [PostBox] nvarchar(400)  NULL
 GO
ALTER TABLE [tblIMS_Records] ADD   [ManagerName] nvarchar(800)  NULL
 GO
ALTER TABLE [tblIMS_Records] ADD   [ActivityOrProduct] nvarchar(4000)  NULL
 GO
ALTER TABLE [tblIMS_Records] ADD   [Establish] nvarchar(200)  NULL
 GO
ALTER TABLE [tblIMS_Records] ADD   [ActivityCode] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_Records] ADD   [Other] nvarchar(MAX)  NULL
 GO
ALTER TABLE [tblIMS_Records] ADD   [Group1] int  NULL
 GO
ALTER TABLE [tblIMS_Records] ADD   [SGroup1] int  NULL
 GO
ALTER TABLE [tblIMS_Records] ADD   [Group2] int  NULL
 GO
ALTER TABLE [tblIMS_Records] ADD   [SGroup2] int  NULL
 GO
ALTER TABLE [tblIMS_Records] ADD   [Group3] int  NULL
 GO
ALTER TABLE [tblIMS_Records] ADD   [SGroup3] int  NULL
 GO

GO
ALTER TABLE [tblIMS_Records] ADD PRIMARY KEY ([TF_Id], [iId]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_Tables] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_Tables_TF_Id] DEFAULT ((newid()))  , 
  [iId] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_Tables] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_Tables_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_Tables] ADD   [iRow] int  NULL
 GO
ALTER TABLE [tblIMS_Tables] ADD   [iId] int  NOT NULL
 GO
ALTER TABLE [tblIMS_Tables] ADD   [chPFormName] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_Tables] ADD   [chEFormName] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_Tables] ADD   [chPTableName] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_Tables] ADD   [chETableName] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_Tables] ADD   [iToolBarNo] int  NULL
 GO
ALTER TABLE [tblIMS_Tables] ADD   [bActive] bit  NULL
 GO
ALTER TABLE [tblIMS_Tables] ADD   [chIconName] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_Tables] ADD   [chDllName] nvarchar(100)  NULL
 GO

GO
ALTER TABLE [tblIMS_Tables] ADD PRIMARY KEY ([TF_Id], [iId]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_UserAccess] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_UserAccess_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_UserAccess] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_UserAccess_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_UserAccess] ADD   [iUserId] int  NULL
 GO
ALTER TABLE [tblIMS_UserAccess] ADD   [iPId] int  NULL
 GO

GO
ALTER TABLE [tblIMS_UserAccess] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_Vacation] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_Vacation_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_Vacation] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_Vacation_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_Vacation] ADD   [UserId] uniqueidentifier  NOT NULL
 GO
ALTER TABLE [tblIMS_Vacation] ADD   [StartDate] nvarchar(16)  NOT NULL
 GO
ALTER TABLE [tblIMS_Vacation] ADD   [StopDate] nvarchar(16)  NOT NULL
 GO
ALTER TABLE [tblIMS_Vacation] ADD   [Result] nvarchar(16)  NULL
 GO

GO
ALTER TABLE [tblIMS_Vacation] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_Version] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_Version_TF_Id] DEFAULT ((newid()))  , 
  [iId] int IDENTITY(1,1) NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_Version] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_Version_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_Version] ADD   [iId] int IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [tblIMS_Version] ADD   [chProjectName] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_Version] ADD   [chVersion] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_Version] ADD   [chNewVerPath] nvarchar(100)  NULL
 GO
ALTER TABLE [tblIMS_Version] ADD   [chMsg] nvarchar(2000)  NULL
 GO
ALTER TABLE [tblIMS_Version] ADD   [chUserName] nvarchar(1000)  NULL
 GO
ALTER TABLE [tblIMS_Version] ADD   [chFilePath] nvarchar(1000)  NULL
 GO

GO
ALTER TABLE [tblIMS_Version] ADD PRIMARY KEY ([TF_Id], [iId]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_WebInf1] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_WebInf1_TF_Id] DEFAULT ((newid()))  , 
  [iId] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_WebInf1] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_WebInf1_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_WebInf1] ADD   [iId] int  NOT NULL
 GO
ALTER TABLE [tblIMS_WebInf1] ADD   [iProductId] int  NULL
 GO
ALTER TABLE [tblIMS_WebInf1] ADD   [chNote] nvarchar(2000)  NULL
 GO

GO
ALTER TABLE [tblIMS_WebInf1] ADD PRIMARY KEY ([TF_Id], [iId]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_WebInf2] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_WebInf2_TF_Id] DEFAULT ((newid()))  , 
  [iId] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_WebInf2] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_WebInf2_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_WebInf2] ADD   [iId] int  NOT NULL
 GO
ALTER TABLE [tblIMS_WebInf2] ADD   [iProductId] int  NULL
 GO
ALTER TABLE [tblIMS_WebInf2] ADD   [chNote1] nvarchar(2000)  NULL
 GO
ALTER TABLE [tblIMS_WebInf2] ADD   [chNote2] nvarchar(2000)  NULL
 GO

GO
ALTER TABLE [tblIMS_WebInf2] ADD PRIMARY KEY ([TF_Id], [iId]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_Work] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_Work_TF_Id] DEFAULT ((newid()))  , 
  [iId] int  NOT NULL , 
  [iRow] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_Work] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_Work_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_Work] ADD   [iId] int  NOT NULL
 GO
ALTER TABLE [tblIMS_Work] ADD   [iRow] int  NOT NULL
 GO
ALTER TABLE [tblIMS_Work] ADD   [iUserId] int  NULL
 GO
ALTER TABLE [tblIMS_Work] ADD   [chWorkTime] nvarchar(24)  NULL
 GO
ALTER TABLE [tblIMS_Work] ADD   [dWork] datetime  NULL
 GO
ALTER TABLE [tblIMS_Work] ADD   [iPId] int  NULL
 GO
ALTER TABLE [tblIMS_Work] ADD   [chDes] text  NULL
 GO
ALTER TABLE [tblIMS_Work] ADD   [iCPId] int  NULL
 GO
ALTER TABLE [tblIMS_Work] ADD   [chDay] nvarchar(18)  NULL
 GO
ALTER TABLE [tblIMS_Work] ADD   [chAlarmDate] nvarchar(20)  NULL
 GO
ALTER TABLE [tblIMS_Work] ADD   [chWorkDate] nvarchar(20)  NULL
 GO
ALTER TABLE [tblIMS_Work] ADD   [CallID] nvarchar(200)  NULL
 GO
ALTER TABLE [tblIMS_Work] ADD   [chFilePath] nvarchar(600)  NULL
 GO
ALTER TABLE [tblIMS_Work] ADD   [chAlarmTime] nvarchar(10)  NULL
 GO
ALTER TABLE [tblIMS_Work] ADD   [iCartablId] int  NULL
 CONSTRAINT [DF_tblIMS_Work_iCartablId] DEFAULT (((0))) 
GO
ALTER TABLE [tblIMS_Work] ADD   [bAlarmSee] bit  NULL
 CONSTRAINT [DF_tblIMS_Work_bAlarmSee] DEFAULT (((0))) 
GO
ALTER TABLE [tblIMS_Work] ADD   [bSee] bit  NULL
 CONSTRAINT [DF_tblIMS_Work_bSee] DEFAULT (((0))) 
GO
ALTER TABLE [tblIMS_Work] ADD   [bFinish] bit  NULL
 CONSTRAINT [DF_tblIMS_Work_bFinish] DEFAULT (((0))) 
GO
ALTER TABLE [tblIMS_Work] ADD   [bDelete] bit  NULL
 CONSTRAINT [DF_tblIMS_Work_bDelete] DEFAULT (((0))) 
GO
ALTER TABLE [tblIMS_Work] ADD   [SerialNumber] nchar(20)  NULL
 GO
ALTER TABLE [tblIMS_Work] ADD   [ProductId] int  NULL
 GO

GO
ALTER TABLE [tblIMS_Work] ADD PRIMARY KEY ([TF_Id], [iId], [iRow]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblIMS_WorkHour] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblIMS_WorkHour_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblIMS_WorkHour] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblIMS_WorkHour_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblIMS_WorkHour] ADD   [iWorkId] bigint  NULL
 GO
ALTER TABLE [tblIMS_WorkHour] ADD   [iDay] smallint  NULL
 GO
ALTER TABLE [tblIMS_WorkHour] ADD   [chDate] nvarchar(20)  NULL
 GO
ALTER TABLE [tblIMS_WorkHour] ADD   [chHour] nvarchar(10)  NULL
 GO

GO
ALTER TABLE [tblIMS_WorkHour] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblSTORE_CheckProdPay] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblSTORE_CheckProdPay_TF_Id] DEFAULT ((newid()))  , 
  [Id] int IDENTITY(1,1) NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblSTORE_CheckProdPay] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblSTORE_CheckProdPay_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblSTORE_CheckProdPay] ADD   [Id] int IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [tblSTORE_CheckProdPay] ADD   [ProdID] bit  NULL
 GO
ALTER TABLE [tblSTORE_CheckProdPay] ADD   [PayID] bit  NULL
 GO

GO
ALTER TABLE [tblSTORE_CheckProdPay] ADD PRIMARY KEY ([TF_Id], [Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblSTORE_CheckStore] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblSTORE_CheckStore_TF_Id] DEFAULT ((newid()))  , 
  [ID] bigint IDENTITY(1,1) NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblSTORE_CheckStore] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblSTORE_CheckStore_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblSTORE_CheckStore] ADD   [IsDeleted] bit  NULL
 GO
ALTER TABLE [tblSTORE_CheckStore] ADD   [ID] bigint IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [tblSTORE_CheckStore] ADD   [UserID] int  NULL
 GO
ALTER TABLE [tblSTORE_CheckStore] ADD   [UserName] nvarchar(100)  NULL
 GO
ALTER TABLE [tblSTORE_CheckStore] ADD   [StuffID] bigint  NULL
 GO
ALTER TABLE [tblSTORE_CheckStore] ADD   [StuffName] nvarchar(100)  NULL
 GO
ALTER TABLE [tblSTORE_CheckStore] ADD   [CheckDate] nvarchar(100)  NULL
 GO
ALTER TABLE [tblSTORE_CheckStore] ADD   [CountWithoutPack] bigint  NULL
 GO
ALTER TABLE [tblSTORE_CheckStore] ADD   [CountPack] bigint  NULL
 GO
ALTER TABLE [tblSTORE_CheckStore] ADD   [ECountWithoutPack] bigint  NULL
 GO
ALTER TABLE [tblSTORE_CheckStore] ADD   [ECountPack] bigint  NULL
 GO
ALTER TABLE [tblSTORE_CheckStore] ADD   [Comment] text  NULL
 GO

GO
ALTER TABLE [tblSTORE_CheckStore] ADD PRIMARY KEY ([TF_Id], [ID]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblSTORE_DynamicBank] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblSTORE_DynamicBank_TF_Id] DEFAULT ((newid()))  , 
  [ID] decimal(18, 0) IDENTITY(1,1) NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblSTORE_DynamicBank] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblSTORE_DynamicBank_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblSTORE_DynamicBank] ADD   [ID] decimal(18, 0) IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [tblSTORE_DynamicBank] ADD   [BankName] nvarchar(100)  NULL
 GO
ALTER TABLE [tblSTORE_DynamicBank] ADD   [Comments1] nvarchar(100)  NULL
 GO
ALTER TABLE [tblSTORE_DynamicBank] ADD   [Comments2] ntext  NULL
 GO

GO
ALTER TABLE [tblSTORE_DynamicBank] ADD PRIMARY KEY ([TF_Id], [ID]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblSTORE_DynamicComments] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblSTORE_DynamicComments_TF_Id] DEFAULT ((newid()))  , 
  [ID] decimal(18, 0) IDENTITY(1,1) NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblSTORE_DynamicComments] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblSTORE_DynamicComments_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblSTORE_DynamicComments] ADD   [ID] decimal(18, 0) IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [tblSTORE_DynamicComments] ADD   [cType] int  NULL
 GO
ALTER TABLE [tblSTORE_DynamicComments] ADD   [Comment] ntext  NULL
 GO
ALTER TABLE [tblSTORE_DynamicComments] ADD   [SellFacture] bit  NULL
 GO
ALTER TABLE [tblSTORE_DynamicComments] ADD   [PreFacture] bit  NULL
 GO
ALTER TABLE [tblSTORE_DynamicComments] ADD   [SooryFacture] bit  NULL
 GO

GO
ALTER TABLE [tblSTORE_DynamicComments] ADD PRIMARY KEY ([TF_Id], [ID]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblSTORE_DynamicNameLogo] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblSTORE_DynamicNameLogo_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblSTORE_DynamicNameLogo] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblSTORE_DynamicNameLogo_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblSTORE_DynamicNameLogo] ADD   [CompanyName] nvarchar(100)  NULL
 GO
ALTER TABLE [tblSTORE_DynamicNameLogo] ADD   [Address] nvarchar(700)  NULL
 GO
ALTER TABLE [tblSTORE_DynamicNameLogo] ADD   [Logo] image  NULL
 GO
ALTER TABLE [tblSTORE_DynamicNameLogo] ADD   [Stamp] image  NULL
 GO
ALTER TABLE [tblSTORE_DynamicNameLogo] ADD   [Email] nvarchar(700)  NULL
 GO
ALTER TABLE [tblSTORE_DynamicNameLogo] ADD   [WebSite] nvarchar(700)  NULL
 GO
ALTER TABLE [tblSTORE_DynamicNameLogo] ADD   [Fax] nvarchar(100)  NULL
 GO

GO
ALTER TABLE [tblSTORE_DynamicNameLogo] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblSTORE_DynamicNameLogoDetails] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblSTORE_DynamicNameLogoDetails_TF_Id] DEFAULT ((newid()))  , 
  [ID] decimal(18, 0) IDENTITY(1,1) NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblSTORE_DynamicNameLogoDetails] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblSTORE_DynamicNameLogoDetails_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblSTORE_DynamicNameLogoDetails] ADD   [ID] decimal(18, 0) IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [tblSTORE_DynamicNameLogoDetails] ADD   [CompanyName] nvarchar(100)  NOT NULL
 GO
ALTER TABLE [tblSTORE_DynamicNameLogoDetails] ADD   [Tel] nvarchar(100)  NULL
 GO

GO
ALTER TABLE [tblSTORE_DynamicNameLogoDetails] ADD PRIMARY KEY ([TF_Id], [ID]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblSTORE_DynamicShelf] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblSTORE_DynamicShelf_TF_Id] DEFAULT ((newid()))  , 
  [ShelfID] int IDENTITY(1,1) NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblSTORE_DynamicShelf] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblSTORE_DynamicShelf_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblSTORE_DynamicShelf] ADD   [ShelfID] int IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [tblSTORE_DynamicShelf] ADD   [ShelfName] nvarchar(100)  NULL
 GO
ALTER TABLE [tblSTORE_DynamicShelf] ADD   [ShelfComments] ntext  NULL
 GO
ALTER TABLE [tblSTORE_DynamicShelf] ADD   [Comments] ntext  NULL
 GO
ALTER TABLE [tblSTORE_DynamicShelf] ADD   [StoreID] int  NULL
 GO
ALTER TABLE [tblSTORE_DynamicShelf] ADD   [StoreName] nvarchar(100)  NULL
 GO

GO
ALTER TABLE [tblSTORE_DynamicShelf] ADD PRIMARY KEY ([TF_Id], [ShelfID]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblSTORE_DynamicStoreIO] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblSTORE_DynamicStoreIO_TF_Id] DEFAULT ((newid()))  , 
  [ID] decimal(18, 0) IDENTITY(1,1) NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblSTORE_DynamicStoreIO] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblSTORE_DynamicStoreIO_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblSTORE_DynamicStoreIO] ADD   [ID] decimal(18, 0) IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [tblSTORE_DynamicStoreIO] ADD   [IO] bit  NULL
 GO
ALTER TABLE [tblSTORE_DynamicStoreIO] ADD   [IsRelated] bit  NULL
 GO
ALTER TABLE [tblSTORE_DynamicStoreIO] ADD   [FType] nvarchar(200)  NULL
 GO
ALTER TABLE [tblSTORE_DynamicStoreIO] ADD   [Comments] ntext  NULL
 GO

GO
ALTER TABLE [tblSTORE_DynamicStoreIO] ADD PRIMARY KEY ([TF_Id], [ID]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblSTORE_DynamicStoreOperator] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblSTORE_DynamicStoreOperator_TF_Id] DEFAULT ((newid()))  , 
  [OpID] int IDENTITY(1,1) NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblSTORE_DynamicStoreOperator] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblSTORE_DynamicStoreOperator_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblSTORE_DynamicStoreOperator] ADD   [OpID] int IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [tblSTORE_DynamicStoreOperator] ADD   [StoreID] int  NULL
 GO
ALTER TABLE [tblSTORE_DynamicStoreOperator] ADD   [OpFName] nvarchar(200)  NULL
 GO
ALTER TABLE [tblSTORE_DynamicStoreOperator] ADD   [OpLName] nvarchar(200)  NULL
 GO
ALTER TABLE [tblSTORE_DynamicStoreOperator] ADD   [Comments] ntext  NULL
 GO

GO
ALTER TABLE [tblSTORE_DynamicStoreOperator] ADD PRIMARY KEY ([TF_Id], [OpID]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblSTORE_DynamicStores] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblSTORE_DynamicStores_TF_Id] DEFAULT ((newid()))  , 
  [StoreID] int IDENTITY(1,1) NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblSTORE_DynamicStores] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblSTORE_DynamicStores_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblSTORE_DynamicStores] ADD   [StoreID] int IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [tblSTORE_DynamicStores] ADD   [StoreName] nvarchar(100)  NULL
 GO
ALTER TABLE [tblSTORE_DynamicStores] ADD   [Comments] ntext  NULL
 GO
ALTER TABLE [tblSTORE_DynamicStores] ADD   [Comments2] ntext  NULL
 GO

GO
ALTER TABLE [tblSTORE_DynamicStores] ADD PRIMARY KEY ([TF_Id], [StoreID]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblSTORE_FinanceForm] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblSTORE_FinanceForm_TF_Id] DEFAULT ((newid()))  , 
  [FormID] decimal(18, 0) IDENTITY(1,1) NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblSTORE_FinanceForm] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblSTORE_FinanceForm_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblSTORE_FinanceForm] ADD   [FormID] decimal(18, 0) IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [tblSTORE_FinanceForm] ADD   [IsDone] bit  NULL
 GO
ALTER TABLE [tblSTORE_FinanceForm] ADD   [IsDeleted] bit  NULL
 GO
ALTER TABLE [tblSTORE_FinanceForm] ADD   [CallType] nvarchar(100)  NULL
 GO
ALTER TABLE [tblSTORE_FinanceForm] ADD   [FactureNO] decimal(18, 0)  NULL
 GO
ALTER TABLE [tblSTORE_FinanceForm] ADD   [FormDate] datetime  NULL
 GO
ALTER TABLE [tblSTORE_FinanceForm] ADD   [CreatorName] nvarchar(200)  NULL
 GO
ALTER TABLE [tblSTORE_FinanceForm] ADD   [CreationDate] datetime  NULL
 GO
ALTER TABLE [tblSTORE_FinanceForm] ADD   [LastEditorName] nvarchar(200)  NULL
 GO
ALTER TABLE [tblSTORE_FinanceForm] ADD   [LastEditDate] datetime  NULL
 GO
ALTER TABLE [tblSTORE_FinanceForm] ADD   [CPID] int  NULL
 GO
ALTER TABLE [tblSTORE_FinanceForm] ADD   [CPName] nvarchar(200)  NULL
 GO
ALTER TABLE [tblSTORE_FinanceForm] ADD   [ChequeID] nvarchar(100)  NULL
 GO
ALTER TABLE [tblSTORE_FinanceForm] ADD   [ChequeDate] datetime  NULL
 GO
ALTER TABLE [tblSTORE_FinanceForm] ADD   [ChequeComm] nvarchar(500)  NULL
 GO
ALTER TABLE [tblSTORE_FinanceForm] ADD   [AccountNO] nvarchar(100)  NULL
 GO
ALTER TABLE [tblSTORE_FinanceForm] ADD   [TotalCash] decimal(18, 0)  NULL
 GO
ALTER TABLE [tblSTORE_FinanceForm] ADD   [TotalCheque] decimal(18, 0)  NULL
 GO
ALTER TABLE [tblSTORE_FinanceForm] ADD   [TotalTransfer] decimal(18, 0)  NULL
 GO
ALTER TABLE [tblSTORE_FinanceForm] ADD   [TransferID] nvarchar(100)  NULL
 GO
ALTER TABLE [tblSTORE_FinanceForm] ADD   [BankID] decimal(18, 0)  NULL
 GO
ALTER TABLE [tblSTORE_FinanceForm] ADD   [BankName] nvarchar(100)  NULL
 GO
ALTER TABLE [tblSTORE_FinanceForm] ADD   [RelatedID] decimal(18, 0)  NULL
 GO
ALTER TABLE [tblSTORE_FinanceForm] ADD   [RelatedType] nvarchar(100)  NULL
 GO
ALTER TABLE [tblSTORE_FinanceForm] ADD   [Comments] ntext  NULL
 GO

GO
ALTER TABLE [tblSTORE_FinanceForm] ADD PRIMARY KEY ([TF_Id], [FormID]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblSTORE_FinancialCP] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblSTORE_FinancialCP_TF_Id] DEFAULT ((newid()))  , 
  [ID] decimal(18, 0) IDENTITY(1,1) NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblSTORE_FinancialCP] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblSTORE_FinancialCP_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblSTORE_FinancialCP] ADD   [ID] decimal(18, 0) IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [tblSTORE_FinancialCP] ADD   [CPID] int  NULL
 GO
ALTER TABLE [tblSTORE_FinancialCP] ADD   [CPName] nvarchar(200)  NULL
 GO
ALTER TABLE [tblSTORE_FinancialCP] ADD   [TotalCred] decimal(18, 0)  NULL
 GO
ALTER TABLE [tblSTORE_FinancialCP] ADD   [TotalDebt] decimal(18, 0)  NULL
 GO
ALTER TABLE [tblSTORE_FinancialCP] ADD   [Comm] ntext  NULL
 GO

GO
ALTER TABLE [tblSTORE_FinancialCP] ADD PRIMARY KEY ([TF_Id], [ID]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblSTORE_FinancialTransacts] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblSTORE_FinancialTransacts_TF_Id] DEFAULT ((newid()))  , 
  [ID] decimal(18, 0) IDENTITY(1,1) NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblSTORE_FinancialTransacts] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblSTORE_FinancialTransacts_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblSTORE_FinancialTransacts] ADD   [ID] decimal(18, 0) IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [tblSTORE_FinancialTransacts] ADD   [Type] nvarchar(100)  NULL
 GO
ALTER TABLE [tblSTORE_FinancialTransacts] ADD   [FormID] decimal(18, 0)  NULL
 GO
ALTER TABLE [tblSTORE_FinancialTransacts] ADD   [FactureID] decimal(18, 0)  NULL
 GO
ALTER TABLE [tblSTORE_FinancialTransacts] ADD   [FactureNO] decimal(18, 0)  NULL
 GO
ALTER TABLE [tblSTORE_FinancialTransacts] ADD   [Date] datetime  NULL
 GO
ALTER TABLE [tblSTORE_FinancialTransacts] ADD   [CreatorName] nvarchar(200)  NULL
 GO
ALTER TABLE [tblSTORE_FinancialTransacts] ADD   [CPID] int  NULL
 GO
ALTER TABLE [tblSTORE_FinancialTransacts] ADD   [CPName] nvarchar(200)  NULL
 GO
ALTER TABLE [tblSTORE_FinancialTransacts] ADD   [Creditor] decimal(18, 0)  NULL
 GO
ALTER TABLE [tblSTORE_FinancialTransacts] ADD   [Debtor] decimal(18, 0)  NULL
 GO
ALTER TABLE [tblSTORE_FinancialTransacts] ADD   [Payfor] ntext  NULL
 GO
ALTER TABLE [tblSTORE_FinancialTransacts] ADD   [Comments] ntext  NULL
 GO

GO
ALTER TABLE [tblSTORE_FinancialTransacts] ADD PRIMARY KEY ([TF_Id], [ID]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblSTORE_iniFactures] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblSTORE_iniFactures_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblSTORE_iniFactures] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblSTORE_iniFactures_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblSTORE_iniFactures] ADD   [FactureName] nvarchar(100)  NULL
 GO
ALTER TABLE [tblSTORE_iniFactures] ADD   [SellerName] nvarchar(100)  NULL
 GO
ALTER TABLE [tblSTORE_iniFactures] ADD   [LastNO] decimal(18, 0)  NULL
 GO

GO
ALTER TABLE [tblSTORE_iniFactures] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblSTORE_MontageSteps] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblSTORE_MontageSteps_TF_Id] DEFAULT ((newid()))  , 
  [ID] decimal(18, 0) IDENTITY(1,1) NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblSTORE_MontageSteps] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblSTORE_MontageSteps_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblSTORE_MontageSteps] ADD   [ID] decimal(18, 0) IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [tblSTORE_MontageSteps] ADD   [ProductID] int  NULL
 GO
ALTER TABLE [tblSTORE_MontageSteps] ADD   [StepName] nvarchar(100)  NULL
 GO
ALTER TABLE [tblSTORE_MontageSteps] ADD   [Comment] nvarchar(100)  NULL
 GO

GO
ALTER TABLE [tblSTORE_MontageSteps] ADD PRIMARY KEY ([TF_Id], [ID]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblSTORE_PackForm] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblSTORE_PackForm_TF_Id] DEFAULT ((newid()))  , 
  [FormID] decimal(18, 0) IDENTITY(1,1) NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblSTORE_PackForm] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblSTORE_PackForm_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblSTORE_PackForm] ADD   [FormID] decimal(18, 0) IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [tblSTORE_PackForm] ADD   [IsDone] bit  NULL
 GO
ALTER TABLE [tblSTORE_PackForm] ADD   [IsDeleted] bit  NULL
 GO
ALTER TABLE [tblSTORE_PackForm] ADD   [FactureNO] decimal(18, 0)  NULL
 GO
ALTER TABLE [tblSTORE_PackForm] ADD   [FormDate] datetime  NULL
 GO
ALTER TABLE [tblSTORE_PackForm] ADD   [CreatorName] nvarchar(200)  NULL
 GO
ALTER TABLE [tblSTORE_PackForm] ADD   [CreationDate] datetime  NULL
 GO
ALTER TABLE [tblSTORE_PackForm] ADD   [LastEditorName] nvarchar(200)  NULL
 GO
ALTER TABLE [tblSTORE_PackForm] ADD   [LastEditDate] datetime  NULL
 GO
ALTER TABLE [tblSTORE_PackForm] ADD   [PackSerialNO] varchar(15)  NULL
 GO
ALTER TABLE [tblSTORE_PackForm] ADD   [PackStoreID] int  NULL
 GO
ALTER TABLE [tblSTORE_PackForm] ADD   [PackStoreName] nvarchar(100)  NULL
 GO
ALTER TABLE [tblSTORE_PackForm] ADD   [PackShelfID] int  NULL
 GO
ALTER TABLE [tblSTORE_PackForm] ADD   [PackShelfName] nvarchar(100)  NULL
 GO
ALTER TABLE [tblSTORE_PackForm] ADD   [Comments] ntext  NULL
 GO
ALTER TABLE [tblSTORE_PackForm] ADD   [DateUnPack] datetime  NULL
 GO

GO
ALTER TABLE [tblSTORE_PackForm] ADD PRIMARY KEY ([TF_Id], [FormID]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblSTORE_PackFormDetails] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblSTORE_PackFormDetails_TF_Id] DEFAULT ((newid()))  , 
  [ID] decimal(18, 0) IDENTITY(1,1) NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblSTORE_PackFormDetails] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblSTORE_PackFormDetails_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblSTORE_PackFormDetails] ADD   [ID] decimal(18, 0) IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [tblSTORE_PackFormDetails] ADD   [ParentFormID] decimal(18, 0)  NULL
 GO
ALTER TABLE [tblSTORE_PackFormDetails] ADD   [HasSerial] bit  NULL
 GO
ALTER TABLE [tblSTORE_PackFormDetails] ADD   [StuffID] int  NULL
 GO
ALTER TABLE [tblSTORE_PackFormDetails] ADD   [StuffSerialNO] varchar(15)  NULL
 GO
ALTER TABLE [tblSTORE_PackFormDetails] ADD   [StuffName] nvarchar(200)  NULL
 GO
ALTER TABLE [tblSTORE_PackFormDetails] ADD   [StuffCount] int  NULL
 GO
ALTER TABLE [tblSTORE_PackFormDetails] ADD   [StuffComments] ntext  NULL
 GO
ALTER TABLE [tblSTORE_PackFormDetails] ADD   [StuffDamaged] bit  NULL
 GO
ALTER TABLE [tblSTORE_PackFormDetails] ADD   [StoreID] int  NULL
 GO
ALTER TABLE [tblSTORE_PackFormDetails] ADD   [StoreName] nvarchar(100)  NULL
 GO
ALTER TABLE [tblSTORE_PackFormDetails] ADD   [ShelfID] int  NULL
 GO
ALTER TABLE [tblSTORE_PackFormDetails] ADD   [ShelfName] nvarchar(100)  NULL
 GO
ALTER TABLE [tblSTORE_PackFormDetails] ADD   [IsDone] bit  NULL
 GO

GO
ALTER TABLE [tblSTORE_PackFormDetails] ADD PRIMARY KEY ([TF_Id], [ID]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblSTORE_ProduceComponents] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblSTORE_ProduceComponents_TF_Id] DEFAULT ((newid()))  , 
  [ID] decimal(18, 0) IDENTITY(1,1) NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblSTORE_ProduceComponents] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblSTORE_ProduceComponents_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblSTORE_ProduceComponents] ADD   [ID] decimal(18, 0) IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [tblSTORE_ProduceComponents] ADD   [ParentFormID] decimal(18, 0)  NULL
 GO
ALTER TABLE [tblSTORE_ProduceComponents] ADD   [HasSerial] bit  NULL
 GO
ALTER TABLE [tblSTORE_ProduceComponents] ADD   [StuffID] int  NULL
 GO
ALTER TABLE [tblSTORE_ProduceComponents] ADD   [StuffSerialNO] varchar(15)  NULL
 GO
ALTER TABLE [tblSTORE_ProduceComponents] ADD   [StuffName] nvarchar(200)  NULL
 GO
ALTER TABLE [tblSTORE_ProduceComponents] ADD   [StuffCount] int  NULL
 GO
ALTER TABLE [tblSTORE_ProduceComponents] ADD   [StuffComments] ntext  NULL
 GO
ALTER TABLE [tblSTORE_ProduceComponents] ADD   [StuffDamaged] bit  NULL
 GO
ALTER TABLE [tblSTORE_ProduceComponents] ADD   [StoreID] int  NULL
 GO
ALTER TABLE [tblSTORE_ProduceComponents] ADD   [StoreName] nvarchar(100)  NULL
 GO
ALTER TABLE [tblSTORE_ProduceComponents] ADD   [ShelfID] int  NULL
 GO
ALTER TABLE [tblSTORE_ProduceComponents] ADD   [ShelfName] nvarchar(100)  NULL
 GO

GO
ALTER TABLE [tblSTORE_ProduceComponents] ADD PRIMARY KEY ([TF_Id], [ID]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblSTORE_ProduceForm] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblSTORE_ProduceForm_TF_Id] DEFAULT ((newid()))  , 
  [FormID] decimal(18, 0) IDENTITY(1,1) NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblSTORE_ProduceForm] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblSTORE_ProduceForm_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblSTORE_ProduceForm] ADD   [FormID] decimal(18, 0) IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [tblSTORE_ProduceForm] ADD   [IsDone] bit  NOT NULL
 CONSTRAINT [DF_tblSTORE_ProduceForm_IsDone] DEFAULT ((0)) 
GO
ALTER TABLE [tblSTORE_ProduceForm] ADD   [IsDeleted] bit  NULL
 GO
ALTER TABLE [tblSTORE_ProduceForm] ADD   [IsFinished] bit  NOT NULL
 CONSTRAINT [DF_tblSTORE_ProduceForm_IsFinished] DEFAULT (((0))) 
GO
ALTER TABLE [tblSTORE_ProduceForm] ADD   [FactureNO] decimal(18, 0)  NULL
 GO
ALTER TABLE [tblSTORE_ProduceForm] ADD   [FormDate] datetime  NULL
 GO
ALTER TABLE [tblSTORE_ProduceForm] ADD   [CreatorName] nvarchar(200)  NULL
 GO
ALTER TABLE [tblSTORE_ProduceForm] ADD   [CreationDate] datetime  NULL
 GO
ALTER TABLE [tblSTORE_ProduceForm] ADD   [LastEditorName] nvarchar(200)  NULL
 GO
ALTER TABLE [tblSTORE_ProduceForm] ADD   [LastEditDate] datetime  NULL
 GO
ALTER TABLE [tblSTORE_ProduceForm] ADD   [Executer] nvarchar(200)  NULL
 GO
ALTER TABLE [tblSTORE_ProduceForm] ADD   [StartDate] datetime  NULL
 GO
ALTER TABLE [tblSTORE_ProduceForm] ADD   [EndDate] datetime  NULL
 GO
ALTER TABLE [tblSTORE_ProduceForm] ADD   [ProductID] int  NULL
 GO
ALTER TABLE [tblSTORE_ProduceForm] ADD   [ProductName] nvarchar(200)  NULL
 GO
ALTER TABLE [tblSTORE_ProduceForm] ADD   [ProductCount] int  NULL
 GO
ALTER TABLE [tblSTORE_ProduceForm] ADD   [Comment] ntext  NULL
 GO

GO
ALTER TABLE [tblSTORE_ProduceForm] ADD PRIMARY KEY ([TF_Id], [FormID]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblSTORE_ProduceProduct] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblSTORE_ProduceProduct_TF_Id] DEFAULT ((newid()))  , 
  [ID] decimal(18, 0) IDENTITY(1,1) NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblSTORE_ProduceProduct] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblSTORE_ProduceProduct_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblSTORE_ProduceProduct] ADD   [ID] decimal(18, 0) IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [tblSTORE_ProduceProduct] ADD   [ParentFormID] decimal(18, 0)  NULL
 GO
ALTER TABLE [tblSTORE_ProduceProduct] ADD   [HasSerial] bit  NULL
 GO
ALTER TABLE [tblSTORE_ProduceProduct] ADD   [StuffID] int  NULL
 GO
ALTER TABLE [tblSTORE_ProduceProduct] ADD   [StuffSerialNO] nvarchar(30)  NULL
 GO
ALTER TABLE [tblSTORE_ProduceProduct] ADD   [StuffName] nvarchar(200)  NULL
 GO
ALTER TABLE [tblSTORE_ProduceProduct] ADD   [StuffCount] int  NULL
 GO
ALTER TABLE [tblSTORE_ProduceProduct] ADD   [StuffComments] ntext  NULL
 GO
ALTER TABLE [tblSTORE_ProduceProduct] ADD   [StuffDamaged] bit  NULL
 GO
ALTER TABLE [tblSTORE_ProduceProduct] ADD   [StoreID] int  NULL
 GO
ALTER TABLE [tblSTORE_ProduceProduct] ADD   [StoreName] nvarchar(100)  NULL
 GO
ALTER TABLE [tblSTORE_ProduceProduct] ADD   [ShelfID] int  NULL
 GO
ALTER TABLE [tblSTORE_ProduceProduct] ADD   [ShelfName] nvarchar(100)  NULL
 GO

GO
ALTER TABLE [tblSTORE_ProduceProduct] ADD PRIMARY KEY ([TF_Id], [ID]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblSTORE_ProduceStepPerson] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblSTORE_ProduceStepPerson_TF_Id] DEFAULT ((newid()))  , 
  [ID] decimal(18, 0) IDENTITY(1,1) NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblSTORE_ProduceStepPerson] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblSTORE_ProduceStepPerson_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblSTORE_ProduceStepPerson] ADD   [ID] decimal(18, 0) IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [tblSTORE_ProduceStepPerson] ADD   [ParentFormID] decimal(18, 0)  NULL
 GO
ALTER TABLE [tblSTORE_ProduceStepPerson] ADD   [StepName] nvarchar(100)  NULL
 GO
ALTER TABLE [tblSTORE_ProduceStepPerson] ADD   [StepPerson] nvarchar(200)  NULL
 GO
ALTER TABLE [tblSTORE_ProduceStepPerson] ADD   [StartDate] datetime  NULL
 GO
ALTER TABLE [tblSTORE_ProduceStepPerson] ADD   [EndDate] datetime  NULL
 GO

GO
ALTER TABLE [tblSTORE_ProduceStepPerson] ADD PRIMARY KEY ([TF_Id], [ID]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblSTORE_SellFacture] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblSTORE_SellFacture_TF_Id] DEFAULT ((newid()))  , 
  [FormID] decimal(18, 0) IDENTITY(1,1) NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblSTORE_SellFacture] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblSTORE_SellFacture_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblSTORE_SellFacture] ADD   [FormID] decimal(18, 0) IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [tblSTORE_SellFacture] ADD   [IsDone] bit  NOT NULL
 CONSTRAINT [DF_tblSTORE_SellFacture_IsDone] DEFAULT (((0))) 
GO
ALTER TABLE [tblSTORE_SellFacture] ADD   [IsDeleted] bit  NULL
 GO
ALTER TABLE [tblSTORE_SellFacture] ADD   [FactureNO] decimal(18, 0)  NULL
 GO
ALTER TABLE [tblSTORE_SellFacture] ADD   [IsPre] bit  NULL
 CONSTRAINT [DF_tblSTORE_SellFacture_IsPre] DEFAULT (((0))) 
GO
ALTER TABLE [tblSTORE_SellFacture] ADD   [FormDate] datetime  NULL
 GO
ALTER TABLE [tblSTORE_SellFacture] ADD   [CreatorName] nvarchar(200)  NULL
 GO
ALTER TABLE [tblSTORE_SellFacture] ADD   [CreationDate] datetime  NULL
 GO
ALTER TABLE [tblSTORE_SellFacture] ADD   [LastEditorName] nvarchar(200)  NULL
 GO
ALTER TABLE [tblSTORE_SellFacture] ADD   [LastEditDate] datetime  NULL
 GO
ALTER TABLE [tblSTORE_SellFacture] ADD   [SellerName] nvarchar(200)  NULL
 GO
ALTER TABLE [tblSTORE_SellFacture] ADD   [RequesterID] int  NULL
 GO
ALTER TABLE [tblSTORE_SellFacture] ADD   [RequesterName] nvarchar(200)  NULL
 GO
ALTER TABLE [tblSTORE_SellFacture] ADD   [PurchaserCPID] int  NULL
 GO
ALTER TABLE [tblSTORE_SellFacture] ADD   [RealCustomerCPID] int  NULL
 GO
ALTER TABLE [tblSTORE_SellFacture] ADD   [Discount] varchar(15)  NULL
 GO
ALTER TABLE [tblSTORE_SellFacture] ADD   [DiscountComment] ntext  NULL
 GO
ALTER TABLE [tblSTORE_SellFacture] ADD   [Discount2] varchar(15)  NULL
 GO
ALTER TABLE [tblSTORE_SellFacture] ADD   [DiscountComment2] ntext  NULL
 GO
ALTER TABLE [tblSTORE_SellFacture] ADD   [Discount3] varchar(15)  NULL
 GO
ALTER TABLE [tblSTORE_SellFacture] ADD   [DiscountComment3] ntext  NULL
 GO
ALTER TABLE [tblSTORE_SellFacture] ADD   [TotalPrice] decimal(18, 0)  NULL
 GO
ALTER TABLE [tblSTORE_SellFacture] ADD   [DynamicCommentIDs] varchar(50)  NULL
 GO
ALTER TABLE [tblSTORE_SellFacture] ADD   [Comments] ntext  NULL
 GO
ALTER TABLE [tblSTORE_SellFacture] ADD   [Title] nvarchar(100)  NULL
 GO
ALTER TABLE [tblSTORE_SellFacture] ADD   [SellerTel] nvarchar(100)  NULL
 GO

GO
ALTER TABLE [tblSTORE_SellFacture] ADD PRIMARY KEY ([TF_Id], [FormID]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblSTORE_SellFacturesDetails] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblSTORE_SellFacturesDetails_TF_Id] DEFAULT ((newid()))  , 
  [ID] decimal(18, 0) IDENTITY(1,1) NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblSTORE_SellFacturesDetails] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblSTORE_SellFacturesDetails_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblSTORE_SellFacturesDetails] ADD   [ID] decimal(18, 0) IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [tblSTORE_SellFacturesDetails] ADD   [ParentFactureID] decimal(18, 0)  NULL
 GO
ALTER TABLE [tblSTORE_SellFacturesDetails] ADD   [HasSerial] bit  NULL
 CONSTRAINT [DF_tblSTORE_SellFacturesDetails_HasSerial] DEFAULT (((0))) 
GO
ALTER TABLE [tblSTORE_SellFacturesDetails] ADD   [StuffID] int  NULL
 GO
ALTER TABLE [tblSTORE_SellFacturesDetails] ADD   [StuffSerialNO] varchar(15)  NULL
 GO
ALTER TABLE [tblSTORE_SellFacturesDetails] ADD   [StuffName] nvarchar(200)  NULL
 GO
ALTER TABLE [tblSTORE_SellFacturesDetails] ADD   [StuffCount] int  NULL
 GO
ALTER TABLE [tblSTORE_SellFacturesDetails] ADD   [StuffComments] ntext  NULL
 GO
ALTER TABLE [tblSTORE_SellFacturesDetails] ADD   [StuffDamaged] bit  NULL
 CONSTRAINT [DF_tblSTORE_SellFacturesDetails_StuffDamaged] DEFAULT (((0))) 
GO
ALTER TABLE [tblSTORE_SellFacturesDetails] ADD   [StuffPrice] decimal(18, 0)  NULL
 GO
ALTER TABLE [tblSTORE_SellFacturesDetails] ADD   [StuffRetCount] int  NULL
 GO
ALTER TABLE [tblSTORE_SellFacturesDetails] ADD   [StuffDiscount] varchar(15)  NULL
 GO
ALTER TABLE [tblSTORE_SellFacturesDetails] ADD   [StuffWarranty] int  NULL
 GO
ALTER TABLE [tblSTORE_SellFacturesDetails] ADD   [StoreID] int  NULL
 GO
ALTER TABLE [tblSTORE_SellFacturesDetails] ADD   [StoreName] nvarchar(100)  NULL
 GO
ALTER TABLE [tblSTORE_SellFacturesDetails] ADD   [ShelfID] int  NULL
 GO
ALTER TABLE [tblSTORE_SellFacturesDetails] ADD   [ShelfName] nvarchar(100)  NULL
 GO
ALTER TABLE [tblSTORE_SellFacturesDetails] ADD   [IsDone] bit  NULL
 GO

GO
ALTER TABLE [tblSTORE_SellFacturesDetails] ADD PRIMARY KEY ([TF_Id], [ID]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblSTORE_SNHistory] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblSTORE_SNHistory_TF_Id] DEFAULT ((newid()))  , 
  [ID] bigint IDENTITY(1,1) NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblSTORE_SNHistory] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblSTORE_SNHistory_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblSTORE_SNHistory] ADD   [ID] bigint IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [tblSTORE_SNHistory] ADD   [Date] nvarchar(100)  NULL
 GO
ALTER TABLE [tblSTORE_SNHistory] ADD   [FormNO] bigint  NULL
 GO
ALTER TABLE [tblSTORE_SNHistory] ADD   [StuffID] bigint  NULL
 GO
ALTER TABLE [tblSTORE_SNHistory] ADD   [StuffName] nvarchar(100)  NULL
 GO
ALTER TABLE [tblSTORE_SNHistory] ADD   [SN] nvarchar(30)  NULL
 GO
ALTER TABLE [tblSTORE_SNHistory] ADD   [IO] smallint  NULL
 GO
ALTER TABLE [tblSTORE_SNHistory] ADD   [IOType] smallint  NULL
 GO
ALTER TABLE [tblSTORE_SNHistory] ADD   [IOTypeID] smallint  NULL
 GO
ALTER TABLE [tblSTORE_SNHistory] ADD   [Comment] nvarchar(100)  NULL
 GO
ALTER TABLE [tblSTORE_SNHistory] ADD   [StuffRetCount] int  NULL
 GO

GO
ALTER TABLE [tblSTORE_SNHistory] ADD PRIMARY KEY ([TF_Id], [ID]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblSTORE_StoreCounts] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblSTORE_StoreCounts_TF_Id] DEFAULT ((newid()))  , 
  [ID] int IDENTITY(1,1) NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblSTORE_StoreCounts] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblSTORE_StoreCounts_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblSTORE_StoreCounts] ADD   [ID] int IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [tblSTORE_StoreCounts] ADD   [StuffID] int  NULL
 GO
ALTER TABLE [tblSTORE_StoreCounts] ADD   [StuffCount] decimal(18, 0)  NULL
 GO
ALTER TABLE [tblSTORE_StoreCounts] ADD   [HasSerial] bit  NULL
 GO
ALTER TABLE [tblSTORE_StoreCounts] ADD   [StoreID] int  NULL
 GO
ALTER TABLE [tblSTORE_StoreCounts] ADD   [ShelfID] int  NULL
 GO
ALTER TABLE [tblSTORE_StoreCounts] ADD   [Comments] ntext  NULL
 GO

GO
ALTER TABLE [tblSTORE_StoreCounts] ADD PRIMARY KEY ([TF_Id], [ID]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblSTORE_StoreHistory] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblSTORE_StoreHistory_TF_Id] DEFAULT ((newid()))  , 
  [ID] decimal(18, 0) IDENTITY(1,1) NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblSTORE_StoreHistory] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblSTORE_StoreHistory_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblSTORE_StoreHistory] ADD   [ID] decimal(18, 0) IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [tblSTORE_StoreHistory] ADD   [HasSerial] bit  NULL
 GO
ALTER TABLE [tblSTORE_StoreHistory] ADD   [SerialNO] varchar(15)  NULL
 GO
ALTER TABLE [tblSTORE_StoreHistory] ADD   [StuffID] int  NULL
 GO
ALTER TABLE [tblSTORE_StoreHistory] ADD   [StuffCount] decimal(18, 0)  NULL
 GO
ALTER TABLE [tblSTORE_StoreHistory] ADD   [CurrentStoreCount] decimal(18, 0)  NULL
 GO
ALTER TABLE [tblSTORE_StoreHistory] ADD   [StoreID] int  NULL
 GO
ALTER TABLE [tblSTORE_StoreHistory] ADD   [FactureID] decimal(18, 0)  NULL
 GO
ALTER TABLE [tblSTORE_StoreHistory] ADD   [FactureNO] decimal(18, 0)  NULL
 GO
ALTER TABLE [tblSTORE_StoreHistory] ADD   [FactureType] nvarchar(100)  NULL
 GO
ALTER TABLE [tblSTORE_StoreHistory] ADD   [TransactionDate] datetime  NULL
 GO
ALTER TABLE [tblSTORE_StoreHistory] ADD   [TransformSN] varchar(15)  NULL
 GO
ALTER TABLE [tblSTORE_StoreHistory] ADD   [CreatorName] nvarchar(200)  NULL
 GO
ALTER TABLE [tblSTORE_StoreHistory] ADD   [InOut] bit  NULL
 GO
ALTER TABLE [tblSTORE_StoreHistory] ADD   [Damaged] bit  NULL
 GO
ALTER TABLE [tblSTORE_StoreHistory] ADD   [Comment] ntext  NULL
 GO

GO
ALTER TABLE [tblSTORE_StoreHistory] ADD PRIMARY KEY ([TF_Id], [ID]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblSTORE_StoreIOFacture] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblSTORE_StoreIOFacture_TF_Id] DEFAULT ((newid()))  , 
  [FormID] decimal(18, 0) IDENTITY(1,1) NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblSTORE_StoreIOFacture] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblSTORE_StoreIOFacture_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblSTORE_StoreIOFacture] ADD   [FormID] decimal(18, 0) IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [tblSTORE_StoreIOFacture] ADD   [IsDone] bit  NOT NULL
 CONSTRAINT [DF_tblSTORE_StoreIOFacture_IsDone] DEFAULT ((0)) 
GO
ALTER TABLE [tblSTORE_StoreIOFacture] ADD   [IsDeleted] bit  NULL
 GO
ALTER TABLE [tblSTORE_StoreIOFacture] ADD   [FactureNO] decimal(18, 0)  NULL
 GO
ALTER TABLE [tblSTORE_StoreIOFacture] ADD   [StoreOperatorID] int  NULL
 GO
ALTER TABLE [tblSTORE_StoreIOFacture] ADD   [StoreOperatorName] nvarchar(200)  NULL
 GO
ALTER TABLE [tblSTORE_StoreIOFacture] ADD   [IO] bit  NULL
 GO
ALTER TABLE [tblSTORE_StoreIOFacture] ADD   [IOTypeID] decimal(18, 0)  NULL
 GO
ALTER TABLE [tblSTORE_StoreIOFacture] ADD   [IOTypeName] nvarchar(200)  NULL
 GO
ALTER TABLE [tblSTORE_StoreIOFacture] ADD   [RelatedAutomaticFacture] decimal(18, 0)  NULL
 GO
ALTER TABLE [tblSTORE_StoreIOFacture] ADD   [RelatedManualFacture] decimal(18, 0)  NULL
 GO
ALTER TABLE [tblSTORE_StoreIOFacture] ADD   [FormDate] datetime  NULL
 GO
ALTER TABLE [tblSTORE_StoreIOFacture] ADD   [CreatorName] nvarchar(0)  NULL
 GO
ALTER TABLE [tblSTORE_StoreIOFacture] ADD   [CreationDate] datetime  NULL
 GO
ALTER TABLE [tblSTORE_StoreIOFacture] ADD   [LastEditorName] nvarchar(200)  NULL
 GO
ALTER TABLE [tblSTORE_StoreIOFacture] ADD   [LastEditDate] datetime  NULL
 GO
ALTER TABLE [tblSTORE_StoreIOFacture] ADD   [PersonelID1] int  NULL
 GO
ALTER TABLE [tblSTORE_StoreIOFacture] ADD   [PersonelName1] nvarchar(200)  NULL
 GO
ALTER TABLE [tblSTORE_StoreIOFacture] ADD   [PersonelID2] int  NULL
 GO
ALTER TABLE [tblSTORE_StoreIOFacture] ADD   [PersonelName2] nvarchar(200)  NULL
 GO
ALTER TABLE [tblSTORE_StoreIOFacture] ADD   [CompanyPersonID] int  NULL
 GO
ALTER TABLE [tblSTORE_StoreIOFacture] ADD   [CompanyPersonName] nvarchar(200)  NULL
 GO
ALTER TABLE [tblSTORE_StoreIOFacture] ADD   [CompanyPersonComment] ntext  NULL
 GO
ALTER TABLE [tblSTORE_StoreIOFacture] ADD   [Comments] ntext  NULL
 GO
ALTER TABLE [tblSTORE_StoreIOFacture] ADD   [Comments2] ntext  NULL
 GO

GO
ALTER TABLE [tblSTORE_StoreIOFacture] ADD PRIMARY KEY ([TF_Id], [FormID]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblSTORE_StoreIOFactureDetails] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblSTORE_StoreIOFactureDetails_TF_Id] DEFAULT ((newid()))  , 
  [ID] decimal(18, 0) IDENTITY(1,1) NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblSTORE_StoreIOFactureDetails] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblSTORE_StoreIOFactureDetails_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblSTORE_StoreIOFactureDetails] ADD   [ID] decimal(18, 0) IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [tblSTORE_StoreIOFactureDetails] ADD   [ParentFormID] decimal(18, 0)  NULL
 GO
ALTER TABLE [tblSTORE_StoreIOFactureDetails] ADD   [HasSerial] bit  NULL
 GO
ALTER TABLE [tblSTORE_StoreIOFactureDetails] ADD   [StuffID] int  NULL
 GO
ALTER TABLE [tblSTORE_StoreIOFactureDetails] ADD   [StuffSerialNO] varchar(15)  NULL
 GO
ALTER TABLE [tblSTORE_StoreIOFactureDetails] ADD   [StuffName] nvarchar(200)  NULL
 GO
ALTER TABLE [tblSTORE_StoreIOFactureDetails] ADD   [StuffCount] int  NULL
 GO
ALTER TABLE [tblSTORE_StoreIOFactureDetails] ADD   [StuffComments] ntext  NULL
 GO
ALTER TABLE [tblSTORE_StoreIOFactureDetails] ADD   [StuffDamaged] bit  NULL
 GO
ALTER TABLE [tblSTORE_StoreIOFactureDetails] ADD   [StoreID] int  NULL
 GO
ALTER TABLE [tblSTORE_StoreIOFactureDetails] ADD   [StoreName] nvarchar(100)  NULL
 GO
ALTER TABLE [tblSTORE_StoreIOFactureDetails] ADD   [ShelfID] int  NULL
 GO
ALTER TABLE [tblSTORE_StoreIOFactureDetails] ADD   [ShelfName] nvarchar(100)  NULL
 GO
ALTER TABLE [tblSTORE_StoreIOFactureDetails] ADD   [RelatedManualFacture] decimal(18, 0)  NULL
 GO

GO
ALTER TABLE [tblSTORE_StoreIOFactureDetails] ADD PRIMARY KEY ([TF_Id], [ID]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblSTORE_StoreSerials] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblSTORE_StoreSerials_TF_Id] DEFAULT ((newid()))  , 
  [SerialNO] varchar(15)  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblSTORE_StoreSerials] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblSTORE_StoreSerials_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblSTORE_StoreSerials] ADD   [SerialNO] varchar(15)  NOT NULL
 GO
ALTER TABLE [tblSTORE_StoreSerials] ADD   [IsBox] bit  NULL
 GO
ALTER TABLE [tblSTORE_StoreSerials] ADD   [ParentSerialNO] varchar(15)  NULL
 GO
ALTER TABLE [tblSTORE_StoreSerials] ADD   [StoreID] int  NULL
 GO
ALTER TABLE [tblSTORE_StoreSerials] ADD   [ShelfID] int  NULL
 GO
ALTER TABLE [tblSTORE_StoreSerials] ADD   [StuffID] int  NULL
 GO
ALTER TABLE [tblSTORE_StoreSerials] ADD   [StuffDamaged] bit  NULL
 GO
ALTER TABLE [tblSTORE_StoreSerials] ADD   [StuffCount] decimal(18, 0)  NULL
 GO
ALTER TABLE [tblSTORE_StoreSerials] ADD   [Comments] ntext  NULL
 GO

GO
ALTER TABLE [tblSTORE_StoreSerials] ADD PRIMARY KEY ([TF_Id], [SerialNO]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblSTORE_TotalAcount] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblSTORE_TotalAcount_TF_Id] DEFAULT ((newid()))  , 
  [ID] bigint IDENTITY(1,1) NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblSTORE_TotalAcount] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblSTORE_TotalAcount_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblSTORE_TotalAcount] ADD   [ID] bigint IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [tblSTORE_TotalAcount] ADD   [CompanyPersonID] bigint  NULL
 GO
ALTER TABLE [tblSTORE_TotalAcount] ADD   [CompanyPersonName] nvarchar(100)  NULL
 GO
ALTER TABLE [tblSTORE_TotalAcount] ADD   [QuarintineID] bigint  NULL
 GO
ALTER TABLE [tblSTORE_TotalAcount] ADD   [QuarintineName] nvarchar(100)  NULL
 GO
ALTER TABLE [tblSTORE_TotalAcount] ADD   [TotalAcount] bigint  NULL
 GO

GO
ALTER TABLE [tblSTORE_TotalAcount] ADD PRIMARY KEY ([TF_Id], [ID]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblSTORE_TotalProduct] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblSTORE_TotalProduct_TF_Id] DEFAULT ((newid()))  , 
  [ID] bigint IDENTITY(1,1) NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblSTORE_TotalProduct] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblSTORE_TotalProduct_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblSTORE_TotalProduct] ADD   [ID] bigint IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [tblSTORE_TotalProduct] ADD   [Type] smallint  NULL
 GO
ALTER TABLE [tblSTORE_TotalProduct] ADD   [StuffID] bigint  NULL
 GO
ALTER TABLE [tblSTORE_TotalProduct] ADD   [StuffName] nvarchar(100)  NULL
 GO
ALTER TABLE [tblSTORE_TotalProduct] ADD   [CountOfWithoutPack] bigint  NULL
 GO
ALTER TABLE [tblSTORE_TotalProduct] ADD   [CountOfPack] bigint  NULL
 GO
ALTER TABLE [tblSTORE_TotalProduct] ADD   [CountOfTotalInPack] bigint  NULL
 GO
ALTER TABLE [tblSTORE_TotalProduct] ADD   [TotalCount] bigint  NULL
 GO
ALTER TABLE [tblSTORE_TotalProduct] ADD   [Comment] nvarchar(100)  NULL
 GO

GO
ALTER TABLE [tblSTORE_TotalProduct] ADD PRIMARY KEY ([TF_Id], [ID]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblSTORE_Transactions] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblSTORE_Transactions_TF_Id] DEFAULT ((newid()))  , 
  [ID] decimal(18, 0) IDENTITY(1,1) NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblSTORE_Transactions] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblSTORE_Transactions_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblSTORE_Transactions] ADD   [ID] decimal(18, 0) IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [tblSTORE_Transactions] ADD   [FormID] decimal(18, 0)  NULL
 GO
ALTER TABLE [tblSTORE_Transactions] ADD   [FormType] nvarchar(100)  NULL
 GO
ALTER TABLE [tblSTORE_Transactions] ADD   [TransactionName] nvarchar(100)  NULL
 GO
ALTER TABLE [tblSTORE_Transactions] ADD   [TransactionDate] datetime  NULL
 GO

GO
ALTER TABLE [tblSTORE_Transactions] ADD PRIMARY KEY ([TF_Id], [ID]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[TelsaFrameWork] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_TelsaFrameWork_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [TelsaFrameWork] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_TelsaFrameWork_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [TelsaFrameWork] ADD   [Data] nvarchar(MAX)  NULL
 GO
ALTER TABLE [TelsaFrameWork] ADD   [MasterPointer] uniqueidentifier  NULL
 GO
ALTER TABLE [TelsaFrameWork] ADD   [PropertyPointer] uniqueidentifier  NULL
 GO
ALTER TABLE [TelsaFrameWork] ADD   [MainPointer] uniqueidentifier  NULL
 GO
ALTER TABLE [TelsaFrameWork] ADD   [Order] int  NULL
 GO
ALTER TABLE [TelsaFrameWork] ADD   [noActive] bit  NOT NULL
 GO
ALTER TABLE [TelsaFrameWork] ADD   [IsRealObject] bit  NULL
 GO
ALTER TABLE [TelsaFrameWork] ADD   [Date] nvarchar(50)  NULL
 GO

GO
ALTER TABLE [TelsaFrameWork] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[TF_Alarm] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_TF_Alarm_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [TF_Alarm] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_TF_Alarm_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [TF_Alarm] ADD   [SenderProjectId] uniqueidentifier  NULL
 GO
ALTER TABLE [TF_Alarm] ADD   [ReceiverProjectId] uniqueidentifier  NULL
 GO
ALTER TABLE [TF_Alarm] ADD   [Message] nvarchar(MAX)  NULL
 GO
ALTER TABLE [TF_Alarm] ADD   [ToUserId] uniqueidentifier  NULL
 GO
ALTER TABLE [TF_Alarm] ADD   [ToAllUser] bit  NULL
 GO
ALTER TABLE [TF_Alarm] ADD   [CreationDate] nvarchar(50)  NULL
 GO
ALTER TABLE [TF_Alarm] ADD   [IsSeen] bit  NULL
 GO
ALTER TABLE [TF_Alarm] ADD   [SeenDate] nvarchar(50)  NULL
 GO
ALTER TABLE [TF_Alarm] ADD   [RunProjectId] uniqueidentifier  NULL
 GO
ALTER TABLE [TF_Alarm] ADD   [IsDone] bit  NULL
 GO
ALTER TABLE [TF_Alarm] ADD   [DoneDate] nvarchar(50)  NULL
 GO

GO
ALTER TABLE [TF_Alarm] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[TF_GeneralSetting] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_TF_GeneralSetting_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [TF_GeneralSetting] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_TF_GeneralSetting_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [TF_GeneralSetting] ADD   [intValue] int  NULL
 GO
ALTER TABLE [TF_GeneralSetting] ADD   [strValue] nvarchar(MAX)  NULL
 GO
ALTER TABLE [TF_GeneralSetting] ADD   [TFPointer] uniqueidentifier  NOT NULL
 GO
ALTER TABLE [TF_GeneralSetting] ADD   [RecordIdPointer] uniqueidentifier  NULL
 GO
ALTER TABLE [TF_GeneralSetting] ADD   [Sequence] int  NOT NULL
 GO

GO
ALTER TABLE [TF_GeneralSetting] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[TF_OfflineProcess] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_TF_OfflineProcess_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [TF_OfflineProcess] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_TF_OfflineProcess_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [TF_OfflineProcess] ADD   [TableIdPointer] uniqueidentifier  NOT NULL
 GO
ALTER TABLE [TF_OfflineProcess] ADD   [RecordIdPointer] uniqueidentifier  NOT NULL
 GO
ALTER TABLE [TF_OfflineProcess] ADD   [ProjectOrder] int  NOT NULL
 GO

GO
ALTER TABLE [TF_OfflineProcess] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[TF_Licence] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_TF_Licence_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [TF_Licence] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_TF_Licence_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [TF_Licence] ADD   [MachineCode] nvarchar(50)  NOT NULL
 GO
ALTER TABLE [TF_Licence] ADD   [LicenceCode] nvarchar(MAX)  NULL
 GO
ALTER TABLE [TF_Licence] ADD   [Block] int  NULL
 GO
ALTER TABLE [TF_Licence] ADD   [Lock] int  NULL
 GO
ALTER TABLE [TF_Licence] ADD   [Acceptance] int  NULL
 GO
ALTER TABLE [TF_Licence] ADD   [Description] nvarchar(MAX)  NULL
 GO
ALTER TABLE [TF_Licence] ADD   [CompanyPersonPointer] uniqueidentifier  NULL
 GO
ALTER TABLE [TF_Licence] ADD   [FactorPointer] uniqueidentifier  NULL
 GO

GO
ALTER TABLE [TF_Licence] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[TF_StatisticalData] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_TF_StatisticalData_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [TF_StatisticalData] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_TF_StatisticalData_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [TF_StatisticalData] ADD   [MachineCodePointer] uniqueidentifier  NOT NULL
 GO
ALTER TABLE [TF_StatisticalData] ADD   [ObjectName] nvarchar(100)  NOT NULL
 GO
ALTER TABLE [TF_StatisticalData] ADD   [Value] nvarchar(100)  NULL
 GO
ALTER TABLE [TF_StatisticalData] ADD   [LocalModifiedDate] bigint  NULL
 GO
ALTER TABLE [TF_StatisticalData] ADD   [RemoteUpdateDate] bigint  NULL
 GO
ALTER TABLE [TF_StatisticalData] ADD   [Description] nvarchar(100)  NULL
 GO

GO
ALTER TABLE [TF_StatisticalData] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[TF_TFCache] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_TF_TFCache_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [TF_TFCache] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_TF_TFCache_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [TF_TFCache] ADD   [Command] uniqueidentifier  NOT NULL
 GO
ALTER TABLE [TF_TFCache] ADD   [InputPointer] uniqueidentifier  NOT NULL
 GO
ALTER TABLE [TF_TFCache] ADD   [InputRelationPointer] uniqueidentifier  NULL
 GO
ALTER TABLE [TF_TFCache] ADD   [ResultPointer] uniqueidentifier  NULL
 GO
ALTER TABLE [TF_TFCache] ADD   [TFData] nvarchar(MAX)  NULL
 GO
ALTER TABLE [TF_TFCache] ADD   [TFOrder] int  NULL
 GO

GO
ALTER TABLE [TF_TFCache] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[TF_AutoUpdateLog] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_TF_AutoUpdateLog_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [TF_AutoUpdateLog] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_TF_AutoUpdateLog_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [TF_AutoUpdateLog] ADD   [MachineCodePointer] uniqueidentifier  NULL
 GO
ALTER TABLE [TF_AutoUpdateLog] ADD   [Date] int  NULL
 GO
ALTER TABLE [TF_AutoUpdateLog] ADD   [Time] int  NULL
 GO
ALTER TABLE [TF_AutoUpdateLog] ADD   [isServer] bit  NULL
 GO
ALTER TABLE [TF_AutoUpdateLog] ADD   [isRecorder] bit  NULL
 GO
ALTER TABLE [TF_AutoUpdateLog] ADD   [PC_Name] nvarchar(MAX)  NULL
 GO

GO
ALTER TABLE [TF_AutoUpdateLog] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[TF_AI] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_TF_AI_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [TF_AI] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_TF_AI_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [TF_AI] ADD   [FactorPointer] uniqueidentifier  NOT NULL
 GO
ALTER TABLE [TF_AI] ADD   [Year] int  NULL
 GO
ALTER TABLE [TF_AI] ADD   [Month] int  NULL
 GO
ALTER TABLE [TF_AI] ADD   [Day] int  NULL
 GO
ALTER TABLE [TF_AI] ADD   [lNumbe_of_Call] int  NULL
 GO
ALTER TABLE [TF_AI] ADD   [CallSecond] int  NULL
 GO
ALTER TABLE [TF_AI] ADD   [WhisperSecond] int  NULL
 GO
ALTER TABLE [TF_AI] ADD   [LlmSecond] int  NULL
 GO

GO
ALTER TABLE [TF_AI] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[CartableManager] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_CartableManager_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [CartableManager] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_CartableManager_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [CartableManager] ADD   [CartableManagerID] int IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [CartableManager] ADD   [SecurityCartableID] int  NULL
 GO
ALTER TABLE [CartableManager] ADD   [ManagerID] int  NULL
 GO

GO
ALTER TABLE [CartableManager] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[ClientsSecurity] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_ClientsSecurity_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [ClientsSecurity] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_ClientsSecurity_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [ClientsSecurity] ADD   [ID] int  NOT NULL
 GO
ALTER TABLE [ClientsSecurity] ADD   [UserName] nvarchar(100)  NULL
 GO
ALTER TABLE [ClientsSecurity] ADD   [Password] nvarchar(100)  NULL
 GO
ALTER TABLE [ClientsSecurity] ADD   [bUserManage] bit  NULL
 GO
ALTER TABLE [ClientsSecurity] ADD   [bArchiveServer] bit  NULL
 GO
ALTER TABLE [ClientsSecurity] ADD   [bOfflineProcess] bit  NULL
 GO
ALTER TABLE [ClientsSecurity] ADD   [bCallCenterPhysicalLayer] bit  NULL
 GO
ALTER TABLE [ClientsSecurity] ADD   [bCallCenterDecoder] bit  NULL
 GO
ALTER TABLE [ClientsSecurity] ADD   [bSetting] bit  NULL
 GO

GO
ALTER TABLE [ClientsSecurity] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[LoginServerGeneralSetting] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_LoginServerGeneralSetting_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [LoginServerGeneralSetting] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_LoginServerGeneralSetting_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [LoginServerGeneralSetting] ADD   [iId] int IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [LoginServerGeneralSetting] ADD   [sConnectionString] ntext  NULL
 GO
ALTER TABLE [LoginServerGeneralSetting] ADD   [iUserId] int  NULL
 GO
ALTER TABLE [LoginServerGeneralSetting] ADD   [chEditTime] nchar(100)  NULL
 GO
ALTER TABLE [LoginServerGeneralSetting] ADD   [bAdminBlankPassTo1] bit  NULL
 GO
ALTER TABLE [LoginServerGeneralSetting] ADD   [bUseSetting] bit  NULL
 GO
ALTER TABLE [LoginServerGeneralSetting] ADD   [bUsesaBlankPass] bit  NULL
 GO

GO
ALTER TABLE [LoginServerGeneralSetting] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[ScheduleSave] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_ScheduleSave_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [ScheduleSave] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_ScheduleSave_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [ScheduleSave] ADD   [ID] int  NOT NULL
 GO
ALTER TABLE [ScheduleSave] ADD   [ChannelID] int  NULL
 GO
ALTER TABLE [ScheduleSave] ADD   [StartTime] nvarchar(20)  NULL
 GO
ALTER TABLE [ScheduleSave] ADD   [EndTime] nvarchar(20)  NULL
 GO
ALTER TABLE [ScheduleSave] ADD   [WeekDay] nchar(20)  NULL
 GO
ALTER TABLE [ScheduleSave] ADD   [Enable] tinyint  NULL
 GO

GO
ALTER TABLE [ScheduleSave] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[SecurityAccess] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_SecurityAccess_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [SecurityAccess] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_SecurityAccess_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [SecurityAccess] ADD   [ID] int  NOT NULL
 GO
ALTER TABLE [SecurityAccess] ADD   [UserID] int  NULL
 GO
ALTER TABLE [SecurityAccess] ADD   [SoftwareID] int  NULL
 GO
ALTER TABLE [SecurityAccess] ADD   [SectionID] int  NULL
 GO
ALTER TABLE [SecurityAccess] ADD   [AccessMode] tinyint  NULL
 GO

GO
ALTER TABLE [SecurityAccess] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[SecurityCartable] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_SecurityCartable_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [SecurityCartable] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_SecurityCartable_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [SecurityCartable] ADD   [ID] int IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [SecurityCartable] ADD   [CartableName] nvarchar(100)  NULL
 GO
ALTER TABLE [SecurityCartable] ADD   [CartableColor] nvarchar(40)  NULL
 GO
ALTER TABLE [SecurityCartable] ADD   [DTMFCode] nvarchar(100)  NULL
 GO
ALTER TABLE [SecurityCartable] ADD   [Comment] nvarchar(140)  NULL
 GO
ALTER TABLE [SecurityCartable] ADD   [Editable] tinyint  NULL
 GO
ALTER TABLE [SecurityCartable] ADD   [Virtual] bit  NULL
 GO
ALTER TABLE [SecurityCartable] ADD   [Path] nvarchar(1000)  NULL
 GO
ALTER TABLE [SecurityCartable] ADD   [DelFiles] bit  NULL
 GO
ALTER TABLE [SecurityCartable] ADD   [Query] ntext  NULL
 GO
ALTER TABLE [SecurityCartable] ADD   [Ctrl] ntext  NULL
 GO
ALTER TABLE [SecurityCartable] ADD   [DelLogs] bit  NULL
 GO
ALTER TABLE [SecurityCartable] ADD   [creator] int  NULL
 GO
ALTER TABLE [SecurityCartable] ADD   [flgCartableMsg] bit  NOT NULL
 CONSTRAINT [DF_SecurityCartable_flgCartableMsg] DEFAULT (((0))) 
GO
ALTER TABLE [SecurityCartable] ADD   [TextCartableMsg] ntext  NULL
 GO
ALTER TABLE [SecurityCartable] ADD   [flgManagerMsg] bit  NOT NULL
 CONSTRAINT [DF_SecurityCartable_flgManagerMsg] DEFAULT (((0))) 
GO
ALTER TABLE [SecurityCartable] ADD   [TextManagerMsg] ntext  NULL
 GO
ALTER TABLE [SecurityCartable] ADD   [flgManagerEmail] bit  NOT NULL
 CONSTRAINT [DF_SecurityCartable_flgManagerEmail] DEFAULT (((0))) 
GO
ALTER TABLE [SecurityCartable] ADD   [TextManagerEmail] ntext  NULL
 GO

GO
ALTER TABLE [SecurityCartable] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[SecurityCartableAccess] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_SecurityCartableAccess_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [SecurityCartableAccess] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_SecurityCartableAccess_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [SecurityCartableAccess] ADD   [iId] int IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [SecurityCartableAccess] ADD   [CartbleId] int  NULL
 GO
ALTER TABLE [SecurityCartableAccess] ADD   [UserId] int  NULL
 GO
ALTER TABLE [SecurityCartableAccess] ADD   [Creator] int  NULL
 GO
ALTER TABLE [SecurityCartableAccess] ADD   [bRead] bit  NULL
 GO
ALTER TABLE [SecurityCartableAccess] ADD   [bWrite] bit  NULL
 GO
ALTER TABLE [SecurityCartableAccess] ADD   [bPlay] bit  NULL
 GO
ALTER TABLE [SecurityCartableAccess] ADD   [bDelete] bit  NULL
 GO
ALTER TABLE [SecurityCartableAccess] ADD   [Edit] int  NULL
 GO

GO
ALTER TABLE [SecurityCartableAccess] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[SecurityChannelAccess] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_SecurityChannelAccess_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [SecurityChannelAccess] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_SecurityChannelAccess_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [SecurityChannelAccess] ADD   [ID] int  NOT NULL
 GO
ALTER TABLE [SecurityChannelAccess] ADD   [UserID] int  NULL
 GO
ALTER TABLE [SecurityChannelAccess] ADD   [ServerID] ntext  NULL
 GO
ALTER TABLE [SecurityChannelAccess] ADD   [CardID] ntext  NULL
 GO
ALTER TABLE [SecurityChannelAccess] ADD   [ChannelID] ntext  NULL
 GO

GO
ALTER TABLE [SecurityChannelAccess] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[SecuritySections] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_SecuritySections_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [SecuritySections] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_SecuritySections_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [SecuritySections] ADD   [ID] int IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [SecuritySections] ADD   [SoftwareID] int  NULL
 GO
ALTER TABLE [SecuritySections] ADD   [SectionName] nvarchar(100)  NULL
 GO
ALTER TABLE [SecuritySections] ADD   [CardSet] tinyint  NULL
 GO
ALTER TABLE [SecuritySections] ADD   [ReadSet] tinyint  NULL
 GO
ALTER TABLE [SecuritySections] ADD   [DeleteSet] tinyint  NULL
 GO
ALTER TABLE [SecuritySections] ADD   [EditSet] tinyint  NULL
 GO
ALTER TABLE [SecuritySections] ADD   [PlaySet] tinyint  NULL
 GO

GO
ALTER TABLE [SecuritySections] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[SecuritySoftware] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_SecuritySoftware_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [SecuritySoftware] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_SecuritySoftware_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [SecuritySoftware] ADD   [ID] int IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [SecuritySoftware] ADD   [Software] nvarchar(100)  NULL
 GO

GO
ALTER TABLE [SecuritySoftware] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblSecurityObjects] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblSecurityObjects_TF_Id] DEFAULT ((newid()))  , 
  [iId] int IDENTITY(1,1) NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblSecurityObjects] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblSecurityObjects_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblSecurityObjects] ADD   [iId] int IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [tblSecurityObjects] ADD   [chProject] nvarchar(100)  NULL
 GO
ALTER TABLE [tblSecurityObjects] ADD   [chObjectName] nvarchar(200)  NULL
 GO
ALTER TABLE [tblSecurityObjects] ADD   [iAccessMode] int  NULL
 GO
ALTER TABLE [tblSecurityObjects] ADD   [iUserId] int  NULL
 GO
ALTER TABLE [tblSecurityObjects] ADD   [iAccessLevel] int  NULL
 GO
ALTER TABLE [tblSecurityObjects] ADD   [iDate] int  NULL
 GO
ALTER TABLE [tblSecurityObjects] ADD   [iObjectId] int  NULL
 GO
ALTER TABLE [tblSecurityObjects] ADD   [chAdv] ntext  NULL
 GO

GO
ALTER TABLE [tblSecurityObjects] ADD PRIMARY KEY ([TF_Id], [iId]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblSecurityUsers] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblSecurityUsers_TF_Id] DEFAULT ((newid()))  , 
  [iId] int IDENTITY(1,1) NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblSecurityUsers] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblSecurityUsers_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblSecurityUsers] ADD   [iId] int IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [tblSecurityUsers] ADD   [chUserName] nvarchar(100)  NULL
 GO
ALTER TABLE [tblSecurityUsers] ADD   [chUserPas] nvarchar(100)  NULL
 GO
ALTER TABLE [tblSecurityUsers] ADD   [iLevel] int  NULL
 GO
ALTER TABLE [tblSecurityUsers] ADD   [chDes] nvarchar(1000)  NULL
 GO
ALTER TABLE [tblSecurityUsers] ADD   [chCreator] nvarchar(100)  NULL
 GO
ALTER TABLE [tblSecurityUsers] ADD   [iStartDate] int  NULL
 GO
ALTER TABLE [tblSecurityUsers] ADD   [iEndDate] int  NULL
 GO
ALTER TABLE [tblSecurityUsers] ADD   [bActive] bit  NULL
 GO
ALTER TABLE [tblSecurityUsers] ADD   [bExpired] bit  NULL
 GO

GO
ALTER TABLE [tblSecurityUsers] ADD PRIMARY KEY ([TF_Id], [iId]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblActiveCheck] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblActiveCheck_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblActiveCheck] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblActiveCheck_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblActiveCheck] ADD   [iId] int IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [tblActiveCheck] ADD   [chLastNum] nchar(20)  NULL
 GO
ALTER TABLE [tblActiveCheck] ADD   [bTibalSend] bit  NULL
 GO
ALTER TABLE [tblActiveCheck] ADD   [bTelsaAck] bit  NULL
 GO

GO
ALTER TABLE [tblActiveCheck] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblCheck_ProdPay] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblCheck_ProdPay_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblCheck_ProdPay] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblCheck_ProdPay_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblCheck_ProdPay] ADD   [Id] int IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [tblCheck_ProdPay] ADD   [ProdID] bit  NULL
 GO
ALTER TABLE [tblCheck_ProdPay] ADD   [PayID] bit  NULL
 GO

GO
ALTER TABLE [tblCheck_ProdPay] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblClientSetting] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblClientSetting_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblClientSetting] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblClientSetting_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblClientSetting] ADD   [iId] int IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [tblClientSetting] ADD   [iLanguage] nchar(20)  NULL
 GO
ALTER TABLE [tblClientSetting] ADD   [iShowIconWindow] smallint  NULL
 GO
ALTER TABLE [tblClientSetting] ADD   [iTimeAdjustMode] smallint  NULL
 GO
ALTER TABLE [tblClientSetting] ADD   [iLogMode] smallint  NULL
 GO
ALTER TABLE [tblClientSetting] ADD   [bAlarmingNewRecord] bit  NULL
 GO
ALTER TABLE [tblClientSetting] ADD   [bDecodeFsk] bit  NULL
 GO
ALTER TABLE [tblClientSetting] ADD   [bAutoRun] bit  NULL
 GO
ALTER TABLE [tblClientSetting] ADD   [bDefaultGoldwave] bit  NULL
 GO
ALTER TABLE [tblClientSetting] ADD   [iblinklongsec] smallint  NULL
 GO
ALTER TABLE [tblClientSetting] ADD   [iIconwindonHeight] int  NULL
 GO
ALTER TABLE [tblClientSetting] ADD   [iIconwindonWidth] int  NULL
 GO
ALTER TABLE [tblClientSetting] ADD   [iIconwindonMode] int  NULL
 GO
ALTER TABLE [tblClientSetting] ADD   [iCallCenterMaxDiffer] smallint  NULL
 GO
ALTER TABLE [tblClientSetting] ADD   [bShowInactiveCards] bit  NULL
 GO
ALTER TABLE [tblClientSetting] ADD   [strCallInfoTable] nvarchar(100)  NULL
 GO
ALTER TABLE [tblClientSetting] ADD   [strShowingElement] nvarchar(510)  NULL
 GO
ALTER TABLE [tblClientSetting] ADD   [strColumnsWidth] nvarchar(510)  NULL
 GO
ALTER TABLE [tblClientSetting] ADD   [strIconWindowElement] nvarchar(510)  NULL
 GO
ALTER TABLE [tblClientSetting] ADD   [strMdiElement] nvarchar(510)  NULL
 GO
ALTER TABLE [tblClientSetting] ADD   [strFont] nvarchar(510)  NULL
 GO
ALTER TABLE [tblClientSetting] ADD   [bTopmostIconWindow] bit  NULL
 GO
ALTER TABLE [tblClientSetting] ADD   [chAdvanced] ntext  NULL
 GO
ALTER TABLE [tblClientSetting] ADD   [iUserId] int  NULL
 GO

GO
ALTER TABLE [tblClientSetting] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblCZ_CCTimeShift] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblCZ_CCTimeShift_TF_Id] DEFAULT ((newid()))  , 
  [iId] int IDENTITY(1,1) NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblCZ_CCTimeShift] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblCZ_CCTimeShift_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblCZ_CCTimeShift] ADD   [iId] int IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [tblCZ_CCTimeShift] ADD   [chCCTime] nvarchar(100)  NULL
 GO
ALTER TABLE [tblCZ_CCTimeShift] ADD   [chTVSTime] nvarchar(100)  NULL
 GO

GO
ALTER TABLE [tblCZ_CCTimeShift] ADD PRIMARY KEY ([TF_Id], [iId]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblPlayLog] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblPlayLog_TF_Id] DEFAULT ((newid()))  , 
  [iId] bigint IDENTITY(1,1) NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblPlayLog] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblPlayLog_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblPlayLog] ADD   [iId] bigint IDENTITY(1,1) NOT NULL
 GO
ALTER TABLE [tblPlayLog] ADD   [iCPId] int  NULL
 GO
ALTER TABLE [tblPlayLog] ADD   [chSystemUserName] nvarchar(100)  NULL
 GO
ALTER TABLE [tblPlayLog] ADD   [chUserName] nvarchar(100)  NULL
 GO
ALTER TABLE [tblPlayLog] ADD   [iUserId] int  NULL
 GO
ALTER TABLE [tblPlayLog] ADD   [chIP] nvarchar(100)  NULL
 GO
ALTER TABLE [tblPlayLog] ADD   [CallId] uniqueidentifier  NOT NULL
 GO
ALTER TABLE [tblPlayLog] ADD   [chDateP] nvarchar(100)  NULL
 GO
ALTER TABLE [tblPlayLog] ADD   [chDateG] nvarchar(100)  NULL
 GO
ALTER TABLE [tblPlayLog] ADD   [chTime] nvarchar(100)  NULL
 GO
ALTER TABLE [tblPlayLog] ADD   [bProfPlay] bit  NULL
 GO
ALTER TABLE [tblPlayLog] ADD   [iProjectCd] int  NULL
 GO
ALTER TABLE [tblPlayLog] ADD   [iType] int  NULL
 GO
ALTER TABLE [tblPlayLog] ADD   [chCommet] nvarchar(1000)  NULL
 GO
ALTER TABLE [tblPlayLog] ADD   [chComment] nvarchar(1000)  NULL
 GO

GO
ALTER TABLE [tblPlayLog] ADD PRIMARY KEY ([TF_Id], [iId]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[User] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_User_TF_Id] DEFAULT ((newid()))  , 
  [Id] int  NOT NULL ) ON [PRIMARY]
GO


GO
ALTER TABLE [User] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_User_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [User] ADD   [Id] int  NOT NULL
 GO
ALTER TABLE [User] ADD   [NickName] nchar(100)  NULL
 GO
ALTER TABLE [User] ADD   [Password] nchar(400)  NULL
 GO
ALTER TABLE [User] ADD   [iLevel] int  NULL
 GO
ALTER TABLE [User] ADD   [bSync] bit  NULL
 GO
ALTER TABLE [User] ADD   [iLastLoginUpdate] bigint  NULL
 GO
ALTER TABLE [User] ADD   [chSysUserName] nvarchar(100)  NULL
 GO
ALTER TABLE [User] ADD   [bLogUserActivit0] bit  NULL
 GO
ALTER TABLE [User] ADD   [bLogUserActivit] bit  NULL
 GO
ALTER TABLE [User] ADD   [noActive] bit  NULL
 GO

GO
ALTER TABLE [User] ADD PRIMARY KEY ([TF_Id], [Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblHW64Config] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblHW64Config_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblHW64Config] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblHW64Config_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblHW64Config] ADD   [RecorderServerPointer] uniqueidentifier  NOT NULL
 GO
ALTER TABLE [tblHW64Config] ADD   [SubjectName] nvarchar(100)  NOT NULL
 GO
ALTER TABLE [tblHW64Config] ADD   [DataName] nvarchar(100)  NOT NULL
 GO
ALTER TABLE [tblHW64Config] ADD   [DataValue] nvarchar(500)  NOT NULL
 GO
ALTER TABLE [tblHW64Config] ADD   [DataValueName] nvarchar(100)  NULL
 GO
ALTER TABLE [tblHW64Config] ADD   [IndexNum] nvarchar(10)  NOT NULL
 GO
ALTER TABLE [tblHW64Config] ADD   [CardJumper] nvarchar(50)  NOT NULL
 GO

GO
ALTER TABLE [tblHW64Config] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[tblHW64Log] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_tblHW64Log_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [tblHW64Log] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_tblHW64Log_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [tblHW64Log] ADD   [ServerName] nvarchar(20)  NOT NULL
 GO
ALTER TABLE [tblHW64Log] ADD   [DateTime] nvarchar(30)  NOT NULL
 GO
ALTER TABLE [tblHW64Log] ADD   [Sender] nvarchar(10)  NOT NULL
 GO
ALTER TABLE [tblHW64Log] ADD   [Receiver] nvarchar(10)  NOT NULL
 GO
ALTER TABLE [tblHW64Log] ADD   [BinaryPacket] nvarchar(400)  NOT NULL
 GO
ALTER TABLE [tblHW64Log] ADD   [TextPacket] nvarchar(500)  NOT NULL
 GO
ALTER TABLE [tblHW64Log] ADD   [SubjectCode] int  NOT NULL
 GO
ALTER TABLE [tblHW64Log] ADD   [SubjectName] nvarchar(100)  NOT NULL
 GO
ALTER TABLE [tblHW64Log] ADD   [CardJumper] nvarchar(50)  NOT NULL
 GO
ALTER TABLE [tblHW64Log] ADD   [IndexName] nvarchar(10)  NOT NULL
 GO
ALTER TABLE [tblHW64Log] ADD   [IndexValue] int  NOT NULL
 GO
ALTER TABLE [tblHW64Log] ADD   [AllData] nvarchar(400)  NULL
 GO

GO
ALTER TABLE [tblHW64Log] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[HZTbl_WithProperty_Article] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_HZTbl_WithProperty_Article_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [HZTbl_WithProperty_Article] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_HZTbl_WithProperty_Article_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [HZTbl_WithProperty_Article] ADD   [TelsaFrameWorkId] uniqueidentifier  NULL
 GO
ALTER TABLE [HZTbl_WithProperty_Article] ADD   [Data] nvarchar(MAX)  NULL
 GO
ALTER TABLE [HZTbl_WithProperty_Article] ADD   [Order] int  NULL
 GO
ALTER TABLE [HZTbl_WithProperty_Article] ADD   [FK_DynamicProperty_Master] uniqueidentifier  NULL
 GO
ALTER TABLE [HZTbl_WithProperty_Article] ADD   [WithProperty_Article] bit  NULL
 GO
ALTER TABLE [HZTbl_WithProperty_Article] ADD   [WithProperty_SlideShow] bit  NULL
 GO
ALTER TABLE [HZTbl_WithProperty_Article] ADD   [WithProperty_Full-width] bit  NULL
 GO
ALTER TABLE [HZTbl_WithProperty_Article] ADD   [WithProperty_Container] bit  NULL
 GO
ALTER TABLE [HZTbl_WithProperty_Article] ADD   [WithProperty_Media] bit  NULL
 GO
ALTER TABLE [HZTbl_WithProperty_Article] ADD   [WithProperty_Link] bit  NULL
 GO
ALTER TABLE [HZTbl_WithProperty_Article] ADD   [WithProperty_MediaFromChild] bit  NULL
 GO
ALTER TABLE [HZTbl_WithProperty_Article] ADD   [WithProperty_Icon] bit  NULL
 GO
ALTER TABLE [HZTbl_WithProperty_Article] ADD   [WithProperty_Tag] bit  NULL
 GO
ALTER TABLE [HZTbl_WithProperty_Article] ADD   [WithProperty_Overlap] bit  NULL
 GO
ALTER TABLE [HZTbl_WithProperty_Article] ADD   [WithRelation_Width] nvarchar(MAX)  NULL
 GO
ALTER TABLE [HZTbl_WithProperty_Article] ADD   [FK_ValidData_Template] uniqueidentifier  NULL
 GO
ALTER TABLE [HZTbl_WithProperty_Article] ADD   [WithRelation_Price] nvarchar(MAX)  NULL
 GO
ALTER TABLE [HZTbl_WithProperty_Article] ADD   [FK_ValidData_Lable] uniqueidentifier  NULL
 GO
ALTER TABLE [HZTbl_WithProperty_Article] ADD   [WithRelation_Farsi] nvarchar(MAX)  NULL
 GO
ALTER TABLE [HZTbl_WithProperty_Article] ADD   [FK_ValidData_Aligment] uniqueidentifier  NULL
 GO
ALTER TABLE [HZTbl_WithProperty_Article] ADD   [WithRelation_BackgroundColor] nvarchar(MAX)  NULL
 GO
ALTER TABLE [HZTbl_WithProperty_Article] ADD   [WithRelation_ExternalLink] nvarchar(MAX)  NULL
 GO
ALTER TABLE [HZTbl_WithProperty_Article] ADD   [WithRelation_Currency] nvarchar(MAX)  NULL
 GO
ALTER TABLE [HZTbl_WithProperty_Article] ADD   [WithRelation_Sale] nvarchar(MAX)  NULL
 GO
ALTER TABLE [HZTbl_WithProperty_Article] ADD   [FK_ValidData_Template] uniqueidentifier  NULL
 GO
ALTER TABLE [HZTbl_WithProperty_Article] ADD   [FK_ValidData_Lable] uniqueidentifier  NULL
 GO
ALTER TABLE [HZTbl_WithProperty_Article] ADD   [FK_ValidData_Aligment] uniqueidentifier  NULL
 GO

GO
ALTER TABLE [HZTbl_WithProperty_Article] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[HZRelationalTbl_Link] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_HZRelationalTbl_Link_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [HZRelationalTbl_Link] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_HZRelationalTbl_Link_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [HZRelationalTbl_Link] ADD   [FK_Article_AsMaster] uniqueidentifier  NULL
 GO
ALTER TABLE [HZRelationalTbl_Link] ADD   [FK_Article_AsDetail] uniqueidentifier  NULL
 GO
ALTER TABLE [HZRelationalTbl_Link] ADD   [Order] int  NULL
 GO

GO
ALTER TABLE [HZRelationalTbl_Link] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[HZRelationalTbl_ShowLink] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_HZRelationalTbl_ShowLink_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [HZRelationalTbl_ShowLink] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_HZRelationalTbl_ShowLink_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [HZRelationalTbl_ShowLink] ADD   [FK_Article_AsMaster] uniqueidentifier  NULL
 GO
ALTER TABLE [HZRelationalTbl_ShowLink] ADD   [FK_Article_AsDetail] uniqueidentifier  NULL
 GO
ALTER TABLE [HZRelationalTbl_ShowLink] ADD   [Order] int  NULL
 GO

GO
ALTER TABLE [HZRelationalTbl_ShowLink] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[HZRelationalTbl_Menu] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_HZRelationalTbl_Menu_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [HZRelationalTbl_Menu] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_HZRelationalTbl_Menu_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [HZRelationalTbl_Menu] ADD   [FK_Article_AsMaster] uniqueidentifier  NULL
 GO
ALTER TABLE [HZRelationalTbl_Menu] ADD   [FK_Article_AsDetail] uniqueidentifier  NULL
 GO
ALTER TABLE [HZRelationalTbl_Menu] ADD   [Order] int  NULL
 GO

GO
ALTER TABLE [HZRelationalTbl_Menu] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[HZRelationalTbl_Socials] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_HZRelationalTbl_Socials_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [HZRelationalTbl_Socials] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_HZRelationalTbl_Socials_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [HZRelationalTbl_Socials] ADD   [FK_Article_AsMaster] uniqueidentifier  NULL
 GO
ALTER TABLE [HZRelationalTbl_Socials] ADD   [FK_Article_AsDetail] uniqueidentifier  NULL
 GO
ALTER TABLE [HZRelationalTbl_Socials] ADD   [Order] int  NULL
 GO

GO
ALTER TABLE [HZRelationalTbl_Socials] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[HZRelationalTbl_Icon] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_HZRelationalTbl_Icon_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [HZRelationalTbl_Icon] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_HZRelationalTbl_Icon_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [HZRelationalTbl_Icon] ADD   [FK_Article_AsMaster] uniqueidentifier  NULL
 GO
ALTER TABLE [HZRelationalTbl_Icon] ADD   [FK_Article_AsDetail] uniqueidentifier  NULL
 GO
ALTER TABLE [HZRelationalTbl_Icon] ADD   [Order] int  NULL
 GO

GO
ALTER TABLE [HZRelationalTbl_Icon] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[HZRelationalTbl_Pricelist] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_HZRelationalTbl_Pricelist_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [HZRelationalTbl_Pricelist] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_HZRelationalTbl_Pricelist_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [HZRelationalTbl_Pricelist] ADD   [FK_Article_AsMaster] uniqueidentifier  NULL
 GO
ALTER TABLE [HZRelationalTbl_Pricelist] ADD   [FK_Article_AsDetail] uniqueidentifier  NULL
 GO
ALTER TABLE [HZRelationalTbl_Pricelist] ADD   [Order] int  NULL
 GO

GO
ALTER TABLE [HZRelationalTbl_Pricelist] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[HZRelationalTblAsMaster_DynamicProperty] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_HZRelationalTblAsMaster_DynamicProperty_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [HZRelationalTblAsMaster_DynamicProperty] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_HZRelationalTblAsMaster_DynamicProperty_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [HZRelationalTblAsMaster_DynamicProperty] ADD   [TelsaFrameWorkId] uniqueidentifier  NULL
 GO
ALTER TABLE [HZRelationalTblAsMaster_DynamicProperty] ADD   [Data] nvarchar(MAX)  NULL
 GO
ALTER TABLE [HZRelationalTblAsMaster_DynamicProperty] ADD   [Order] int  NULL
 GO
ALTER TABLE [HZRelationalTblAsMaster_DynamicProperty] ADD   [FK_ValidData_Aligment] uniqueidentifier  NULL
 GO

GO
ALTER TABLE [HZRelationalTblAsMaster_DynamicProperty] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[HZValidDataTbl_Aligment] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_HZValidDataTbl_Aligment_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [HZValidDataTbl_Aligment] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_HZValidDataTbl_Aligment_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [HZValidDataTbl_Aligment] ADD   [Data] nvarchar(MAX)  NULL
 GO
ALTER TABLE [HZValidDataTbl_Aligment] ADD   [Order] int  NULL
 GO

GO
ALTER TABLE [HZValidDataTbl_Aligment] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[HZTbl_DetailOfRelation_Class] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_HZTbl_DetailOfRelation_Class_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [HZTbl_DetailOfRelation_Class] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_HZTbl_DetailOfRelation_Class_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [HZTbl_DetailOfRelation_Class] ADD   [TelsaFrameWorkId] uniqueidentifier  NULL
 GO
ALTER TABLE [HZTbl_DetailOfRelation_Class] ADD   [Data] nvarchar(MAX)  NULL
 GO
ALTER TABLE [HZTbl_DetailOfRelation_Class] ADD   [Order] int  NULL
 GO
ALTER TABLE [HZTbl_DetailOfRelation_Class] ADD   [FK_DynamicProperty_Master] uniqueidentifier  NULL
 GO
ALTER TABLE [HZTbl_DetailOfRelation_Class] ADD   [FK_Article] uniqueidentifier  NULL
 GO

GO
ALTER TABLE [HZTbl_DetailOfRelation_Class] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[HZRelationalTblAsDetail_DynamicProperty] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_HZRelationalTblAsDetail_DynamicProperty_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [HZRelationalTblAsDetail_DynamicProperty] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_HZRelationalTblAsDetail_DynamicProperty_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [HZRelationalTblAsDetail_DynamicProperty] ADD   [TelsaFrameWorkId] uniqueidentifier  NULL
 GO
ALTER TABLE [HZRelationalTblAsDetail_DynamicProperty] ADD   [Data] nvarchar(MAX)  NULL
 GO
ALTER TABLE [HZRelationalTblAsDetail_DynamicProperty] ADD   [Order] int  NULL
 GO

GO
ALTER TABLE [HZRelationalTblAsDetail_DynamicProperty] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[HZRelationalTblMasterDetail_DynamicProperty] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_HZRelationalTblMasterDetail_DynamicProperty_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [HZRelationalTblMasterDetail_DynamicProperty] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_HZRelationalTblMasterDetail_DynamicProperty_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [HZRelationalTblMasterDetail_DynamicProperty] ADD   [FK_DynamicProperty_Master_AsMaster] uniqueidentifier  NULL
 GO
ALTER TABLE [HZRelationalTblMasterDetail_DynamicProperty] ADD   [FK_DynamicProperty_Detail_AsDetail] uniqueidentifier  NULL
 GO

GO
ALTER TABLE [HZRelationalTblMasterDetail_DynamicProperty] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[HZRelationalTbl_Article_DynamicProperty] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_HZRelationalTbl_Article_DynamicProperty_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [HZRelationalTbl_Article_DynamicProperty] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_HZRelationalTbl_Article_DynamicProperty_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [HZRelationalTbl_Article_DynamicProperty] ADD   [FK_Article] uniqueidentifier  NULL
 GO
ALTER TABLE [HZRelationalTbl_Article_DynamicProperty] ADD   [FK_DynamicProperty_Detail] uniqueidentifier  NULL
 GO
ALTER TABLE [HZRelationalTbl_Article_DynamicProperty] ADD   [Value] nvarchar(MAX)  NULL
 GO

GO
ALTER TABLE [HZRelationalTbl_Article_DynamicProperty] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[HZValidDataTbl_Template] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_HZValidDataTbl_Template_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [HZValidDataTbl_Template] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_HZValidDataTbl_Template_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [HZValidDataTbl_Template] ADD   [Data] nvarchar(MAX)  NULL
 GO
ALTER TABLE [HZValidDataTbl_Template] ADD   [Order] int  NULL
 GO
ALTER TABLE [HZValidDataTbl_Template] ADD   [WithProperty_Border] bit  NULL
 GO
ALTER TABLE [HZValidDataTbl_Template] ADD   [FK_ValidData_MediaAlignement] uniqueidentifier  NULL
 GO

GO
ALTER TABLE [HZValidDataTbl_Template] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[HZValidDataTbl_MediaAlignement] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_HZValidDataTbl_MediaAlignement_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [HZValidDataTbl_MediaAlignement] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_HZValidDataTbl_MediaAlignement_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [HZValidDataTbl_MediaAlignement] ADD   [Data] nvarchar(MAX)  NULL
 GO
ALTER TABLE [HZValidDataTbl_MediaAlignement] ADD   [Order] int  NULL
 GO

GO
ALTER TABLE [HZValidDataTbl_MediaAlignement] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[HZTbl_DetailOfRelation_TemplateStructure] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_HZTbl_DetailOfRelation_TemplateStructure_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [HZTbl_DetailOfRelation_TemplateStructure] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_HZTbl_DetailOfRelation_TemplateStructure_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [HZTbl_DetailOfRelation_TemplateStructure] ADD   [FK_ValidData_TemplateStructure] uniqueidentifier  NULL
 GO
ALTER TABLE [HZTbl_DetailOfRelation_TemplateStructure] ADD   [Order] int  NULL
 GO
ALTER TABLE [HZTbl_DetailOfRelation_TemplateStructure] ADD   [WithProperty_SingleRelation] bit  NULL
 GO
ALTER TABLE [HZTbl_DetailOfRelation_TemplateStructure] ADD   [FK_ValidData_Aligment] uniqueidentifier  NULL
 GO
ALTER TABLE [HZTbl_DetailOfRelation_TemplateStructure] ADD   [FK_ValidData_Template] uniqueidentifier  NULL
 GO

GO
ALTER TABLE [HZTbl_DetailOfRelation_TemplateStructure] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[HZValidDataTbl_TemplateStructure] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_HZValidDataTbl_TemplateStructure_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [HZValidDataTbl_TemplateStructure] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_HZValidDataTbl_TemplateStructure_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [HZValidDataTbl_TemplateStructure] ADD   [Data] nvarchar(MAX)  NULL
 GO
ALTER TABLE [HZValidDataTbl_TemplateStructure] ADD   [Order] int  NULL
 GO
ALTER TABLE [HZValidDataTbl_TemplateStructure] ADD   [WithProperty_SingleRelation] bit  NULL
 GO

GO
ALTER TABLE [HZValidDataTbl_TemplateStructure] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[HZValidDataTbl_Lable] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_HZValidDataTbl_Lable_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [HZValidDataTbl_Lable] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_HZValidDataTbl_Lable_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [HZValidDataTbl_Lable] ADD   [Data] nvarchar(MAX)  NULL
 GO
ALTER TABLE [HZValidDataTbl_Lable] ADD   [Order] int  NULL
 GO

GO
ALTER TABLE [HZValidDataTbl_Lable] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[HZTbl_DetailOfRelation_Media] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_HZTbl_DetailOfRelation_Media_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [HZTbl_DetailOfRelation_Media] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_HZTbl_DetailOfRelation_Media_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [HZTbl_DetailOfRelation_Media] ADD   [TelsaFrameWorkId] uniqueidentifier  NULL
 GO
ALTER TABLE [HZTbl_DetailOfRelation_Media] ADD   [Data] nvarchar(MAX)  NULL
 GO
ALTER TABLE [HZTbl_DetailOfRelation_Media] ADD   [Order] int  NULL
 GO
ALTER TABLE [HZTbl_DetailOfRelation_Media] ADD   [WithProperty_jpg] bit  NULL
 GO
ALTER TABLE [HZTbl_DetailOfRelation_Media] ADD   [WithProperty_File] bit  NULL
 GO
ALTER TABLE [HZTbl_DetailOfRelation_Media] ADD   [WithProperty_png] bit  NULL
 GO
ALTER TABLE [HZTbl_DetailOfRelation_Media] ADD   [WithProperty_Alt] bit  NULL
 GO
ALTER TABLE [HZTbl_DetailOfRelation_Media] ADD   [WithProperty_svg] bit  NULL
 GO
ALTER TABLE [HZTbl_DetailOfRelation_Media] ADD   [WithProperty_Other] bit  NULL
 GO
ALTER TABLE [HZTbl_DetailOfRelation_Media] ADD   [WithRelation_Alt] nvarchar(MAX)  NULL
 GO
ALTER TABLE [HZTbl_DetailOfRelation_Media] ADD   [WithRelation_Zoom] nvarchar(MAX)  NULL
 GO
ALTER TABLE [HZTbl_DetailOfRelation_Media] ADD   [FK_Article] uniqueidentifier  NULL
 GO
ALTER TABLE [HZTbl_DetailOfRelation_Media] ADD   [FK_ShowLink] uniqueidentifier  NULL
 GO
ALTER TABLE [HZTbl_DetailOfRelation_Media] ADD   [FK_Icon] uniqueidentifier  NULL
 GO
ALTER TABLE [HZTbl_DetailOfRelation_Media] ADD   [FK_Link] uniqueidentifier  NULL
 GO

GO
ALTER TABLE [HZTbl_DetailOfRelation_Media] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[HZTbl_DetailOfRelation_Content] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_HZTbl_DetailOfRelation_Content_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [HZTbl_DetailOfRelation_Content] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_HZTbl_DetailOfRelation_Content_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [HZTbl_DetailOfRelation_Content] ADD   [TelsaFrameWorkId] uniqueidentifier  NULL
 GO
ALTER TABLE [HZTbl_DetailOfRelation_Content] ADD   [Data] nvarchar(MAX)  NULL
 GO
ALTER TABLE [HZTbl_DetailOfRelation_Content] ADD   [Order] int  NULL
 GO
ALTER TABLE [HZTbl_DetailOfRelation_Content] ADD   [FK_Article] uniqueidentifier  NULL
 GO
ALTER TABLE [HZTbl_DetailOfRelation_Content] ADD   [FK_Link] uniqueidentifier  NULL
 GO
ALTER TABLE [HZTbl_DetailOfRelation_Content] ADD   [FK_ShowLink] uniqueidentifier  NULL
 GO

GO
ALTER TABLE [HZTbl_DetailOfRelation_Content] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[HZTbl_DetailOfRelation_Download] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_HZTbl_DetailOfRelation_Download_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [HZTbl_DetailOfRelation_Download] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_HZTbl_DetailOfRelation_Download_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [HZTbl_DetailOfRelation_Download] ADD   [TelsaFrameWorkId] uniqueidentifier  NULL
 GO
ALTER TABLE [HZTbl_DetailOfRelation_Download] ADD   [Data] nvarchar(MAX)  NULL
 GO
ALTER TABLE [HZTbl_DetailOfRelation_Download] ADD   [Order] int  NULL
 GO
ALTER TABLE [HZTbl_DetailOfRelation_Download] ADD   [WithProperty_Other] bit  NULL
 GO
ALTER TABLE [HZTbl_DetailOfRelation_Download] ADD   [WithProperty_File] bit  NULL
 GO
ALTER TABLE [HZTbl_DetailOfRelation_Download] ADD   [WithProperty_exe] bit  NULL
 GO
ALTER TABLE [HZTbl_DetailOfRelation_Download] ADD   [WithRelation_Value] nvarchar(MAX)  NULL
 GO
ALTER TABLE [HZTbl_DetailOfRelation_Download] ADD   [FK_Article] uniqueidentifier  NULL
 GO
ALTER TABLE [HZTbl_DetailOfRelation_Download] ADD   [FK_ShowLink] uniqueidentifier  NULL
 GO
ALTER TABLE [HZTbl_DetailOfRelation_Download] ADD   [FK_Link] uniqueidentifier  NULL
 GO

GO
ALTER TABLE [HZTbl_DetailOfRelation_Download] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO
CREATE TABLE [dbo].[HZTbl_DetailOfRelation_Tag] (
    [TF_Id] uniqueidentifier  NOT NULL CONSTRAINT [DF_HZTbl_DetailOfRelation_Tag_TF_Id] DEFAULT ((newid()))  ) ON [PRIMARY]
GO


GO
ALTER TABLE [HZTbl_DetailOfRelation_Tag] ADD   [TF_Id] uniqueidentifier  NOT NULL
 CONSTRAINT [DF_HZTbl_DetailOfRelation_Tag_TF_Id] DEFAULT ((newid())) 
GO
ALTER TABLE [HZTbl_DetailOfRelation_Tag] ADD   [TelsaFrameWorkId] uniqueidentifier  NULL
 GO
ALTER TABLE [HZTbl_DetailOfRelation_Tag] ADD   [Data] nvarchar(MAX)  NULL
 GO
ALTER TABLE [HZTbl_DetailOfRelation_Tag] ADD   [Order] int  NULL
 GO
ALTER TABLE [HZTbl_DetailOfRelation_Tag] ADD   [FK_Article] uniqueidentifier  NULL
 GO

GO
ALTER TABLE [HZTbl_DetailOfRelation_Tag] ADD PRIMARY KEY ([TF_Id]) ON [PRIMARY]


GO

GO

GO

GO
 ALTER TABLE [CallCenterFormat]  WITH CHECK ADD CONSTRAINT [FK_CallCenterFormat_CallCenterPhysicalLayer]  FOREIGN KEY([PhysicalLayerId]) REFERENCES [CallCenterPhysicalLayer] ([TF_Id]) ;
GO


GO
 ALTER TABLE [CallCenterMessage]  WITH CHECK ADD CONSTRAINT [FK_CallCenterMessage_CallCenterPhysicalLayer]  FOREIGN KEY([PhysicalLayerId]) REFERENCES [CallCenterPhysicalLayer] ([TF_Id]) ;
GO


GO


GO
 ALTER TABLE [OfflineCallInfo]  WITH CHECK ADD CONSTRAINT [FK_OfflineCallInfo_OfflineRecordServers]  FOREIGN KEY([RecordServerID]) REFERENCES [OfflineRecordServers] ([ServerID]) ;
GO
 ALTER TABLE [OfflineCallInfo]  WITH CHECK ADD CONSTRAINT [FK_OfflineCallInfo_OfflineCard1]  FOREIGN KEY([CardID]) REFERENCES [OfflineCard] ([CardID]) ;
GO
 ALTER TABLE [OfflineCallInfo]  WITH CHECK ADD CONSTRAINT [FK_OfflineCallInfo_OfflineChannel2]  FOREIGN KEY([ChannelID]) REFERENCES [OfflineChannel] ([ChannelID]) ;
GO
 ALTER TABLE [OfflineCallInfo]  WITH CHECK ADD CONSTRAINT [FK_OfflineCallInfo_OfflinePath3]  FOREIGN KEY([LocationID]) REFERENCES [OfflinePath] ([TF_Id]) ;
GO
 ALTER TABLE [OfflineCallInfo]  WITH CHECK ADD CONSTRAINT [FK_OfflineCallInfo_OfflineFax4]  FOREIGN KEY([FaxID]) REFERENCES [OfflineFax] ([FaxID]) ;
GO


GO
 ALTER TABLE [OfflineCard]  WITH CHECK ADD CONSTRAINT [FK_OfflineCard_OfflineRecordServers]  FOREIGN KEY([RecordServerID]) REFERENCES [OfflineRecordServers] ([ServerID]) ;
GO


GO
 ALTER TABLE [OfflineChannel]  WITH CHECK ADD CONSTRAINT [FK_OfflineChannel_OfflineRecordServers]  FOREIGN KEY([RecordServerID]) REFERENCES [OfflineRecordServers] ([ServerID]) ;
GO
 ALTER TABLE [OfflineChannel]  WITH CHECK ADD CONSTRAINT [FK_OfflineChannel_OfflineCard1]  FOREIGN KEY([CardID]) REFERENCES [OfflineCard] ([CardID]) ;
GO


GO


GO
 ALTER TABLE [OfflineRecordServerPath]  WITH CHECK ADD CONSTRAINT [FK_OfflineRecordServerPath_OfflineRecordServers]  FOREIGN KEY([RecorderServerPointer]) REFERENCES [OfflineRecordServers] ([TF_Id]) ;
GO


GO


GO
 ALTER TABLE [OfflinePath]  WITH CHECK ADD CONSTRAINT [FK_OfflinePath_TF_GeneralSetting]  FOREIGN KEY([GeneralSettingPointer]) REFERENCES [TF_GeneralSetting] ([TF_Id]) ;
GO


GO


GO


GO


GO
 ALTER TABLE [tblIMS_Bug]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_Bug_tblIMS_CompanyPerson]  FOREIGN KEY([iUserId]) REFERENCES [tblIMS_CompanyPerson] ([iId]) ;
GO


GO
 ALTER TABLE [tblIMS_BugDetail]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_BugDetail_tblIMS_CompanyPerson]  FOREIGN KEY([iProgrammerId]) REFERENCES [tblIMS_CompanyPerson] ([iId]) ;
GO


GO


GO
 ALTER TABLE [tblIMS_Bylaw]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_Bylaw_tblIMS_CompanyPerson]  FOREIGN KEY([iUserId]) REFERENCES [tblIMS_CompanyPerson] ([iId]) ;
GO


GO
 ALTER TABLE [tblIMS_Calendar]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_Calendar_tblIMS_CompanyPerson]  FOREIGN KEY([iUserId]) REFERENCES [tblIMS_CompanyPerson] ([iId]) ;
GO


GO
 ALTER TABLE [tblIMS_Cartabl]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_Cartabl_tblIMS_Cartabl]  FOREIGN KEY([iParentId]) REFERENCES [tblIMS_Cartabl] ([iId]) ;
GO
 ALTER TABLE [tblIMS_Cartabl]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_Cartabl_tblIMS_CompanyPerson1]  FOREIGN KEY([iUserId]) REFERENCES [tblIMS_CompanyPerson] ([iId]) ;
GO
 ALTER TABLE [tblIMS_Cartabl]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_Cartabl_tblIMS_FixCartabl2]  FOREIGN KEY([iFixCartablCd]) REFERENCES [tblIMS_FixCartabl] ([iCd]) ;
GO


GO


GO
 ALTER TABLE [tblIMS_CityTelCd]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_CityTelCd_tblIMS_City]  FOREIGN KEY([iMumCd]) REFERENCES [tblIMS_City] ([iCd]) ;
GO


GO


GO


GO
 ALTER TABLE [tblIMS_CompanyPerson]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_CompanyPerson_tblIMS_CompanyPerson]  FOREIGN KEY([iUserId]) REFERENCES [tblIMS_CompanyPerson] ([iId]) ;
GO
 ALTER TABLE [tblIMS_CompanyPerson]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_CompanyPerson_tblIMS_CJobGroup1]  FOREIGN KEY([iCJobGroupCd]) REFERENCES [tblIMS_CJobGroup] ([iCd]) ;
GO
 ALTER TABLE [tblIMS_CompanyPerson]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_CompanyPerson_tblIMS_City2]  FOREIGN KEY([iCityCd]) REFERENCES [tblIMS_City] ([iCd]) ;
GO
 ALTER TABLE [tblIMS_CompanyPerson]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_CompanyPerson_tblIMS_PJobTitle3]  FOREIGN KEY([iPJobTitleCd]) REFERENCES [tblIMS_PJobTitle] ([iCd]) ;
GO
 ALTER TABLE [tblIMS_CompanyPerson]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_CompanyPerson_tblIMS_CompanyPerson4]  FOREIGN KEY([iCId]) REFERENCES [tblIMS_CompanyPerson] ([iId]) ;
GO
 ALTER TABLE [tblIMS_CompanyPerson]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_CompanyPerson_tblIMS_CustLevel5]  FOREIGN KEY([iCustLevelCd]) REFERENCES [tblIMS_CustLevel] ([iCd]) ;
GO


GO


GO


GO


GO


GO


GO


GO


GO
 ALTER TABLE [tblIMS_Employ]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_Employ_tblIMS_City]  FOREIGN KEY([iCityCd]) REFERENCES [tblIMS_City] ([iCd]) ;
GO
 ALTER TABLE [tblIMS_Employ]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_Employ_tblIMS_CompanyUnit1]  FOREIGN KEY([iCompanyUnitCd]) REFERENCES [tblIMS_CompanyUnit] ([iCd]) ;
GO
 ALTER TABLE [tblIMS_Employ]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_Employ_tblIMS_CompanyPerson2]  FOREIGN KEY([iCompanyPersonId]) REFERENCES [tblIMS_CompanyPerson] ([iId]) ;
GO


GO
 ALTER TABLE [tblIMS_EmployKnowledge]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_EmployKnowledge_tblIMS_Employ]  FOREIGN KEY([iEmployId]) REFERENCES [tblIMS_Employ] ([iId]) ;
GO


GO
 ALTER TABLE [tblIMS_EmployOpinion]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_EmployOpinion_tblIMS_Employ]  FOREIGN KEY([iEmployId]) REFERENCES [tblIMS_Employ] ([iId]) ;
GO
 ALTER TABLE [tblIMS_EmployOpinion]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_EmployOpinion_tblIMS_CompanyPerson1]  FOREIGN KEY([iUserId]) REFERENCES [tblIMS_CompanyPerson] ([iId]) ;
GO


GO
 ALTER TABLE [tblIMS_EmployPersonal]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_EmployPersonal_tblIMS_Employ]  FOREIGN KEY([iEmployId]) REFERENCES [tblIMS_Employ] ([iId]) ;
GO


GO
 ALTER TABLE [tblIMS_EmploySchoolDoc]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_EmploySchoolDoc_tblIMS_Employ]  FOREIGN KEY([iEmployId]) REFERENCES [tblIMS_Employ] ([iId]) ;
GO


GO
 ALTER TABLE [tblIMS_EmployWorkHistory]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_EmployWorkHistory_tblIMS_Employ]  FOREIGN KEY([iEmployId]) REFERENCES [tblIMS_Employ] ([iId]) ;
GO
 ALTER TABLE [tblIMS_EmployWorkHistory]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_EmployWorkHistory_tblIMS_PJobTitle1]  FOREIGN KEY([iPJobTitleCd]) REFERENCES [tblIMS_PJobTitle] ([iCd]) ;
GO


GO
 ALTER TABLE [tblIMS_Error]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_Error_tblIMS_CompanyPerson]  FOREIGN KEY([iUserId]) REFERENCES [tblIMS_CompanyPerson] ([iId]) ;
GO


GO
 ALTER TABLE [tblIMS_FilePath]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_FilePath_tblIMS_CompanyPerson]  FOREIGN KEY([iUserId]) REFERENCES [tblIMS_CompanyPerson] ([iId]) ;
GO


GO


GO


GO


GO


GO


GO


GO
 ALTER TABLE [tblIMS_GroupComponentProduct]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_GroupComponentProduct_tblIMS_GroupComponentProduct]  FOREIGN KEY([iParentId]) REFERENCES [tblIMS_GroupComponentProduct] ([iId]) ;
GO


GO


GO
 ALTER TABLE [tblIMS_History]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_History_tblIMS_CompanyPerson]  FOREIGN KEY([iUserId]) REFERENCES [tblIMS_CompanyPerson] ([iId]) ;
GO


GO
 ALTER TABLE [tblIMS_Holiday]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_Holiday_tblIMS_CompanyPerson]  FOREIGN KEY([iUserId]) REFERENCES [tblIMS_CompanyPerson] ([iId]) ;
GO


GO
 ALTER TABLE [tblIMS_InternalTel]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_InternalTel_tblIMS_CompanyBuilding]  FOREIGN KEY([iCompanyBuildingCd]) REFERENCES [tblIMS_CompanyBuilding] ([iCd]) ;
GO


GO


GO
 ALTER TABLE [tblIMS_Log]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_Log_tblIMS_CompanyPerson]  FOREIGN KEY([iUserId]) REFERENCES [tblIMS_CompanyPerson] ([iId]) ;
GO


GO
 ALTER TABLE [tblIMS_Meeting]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_Meeting_tblIMS_CompanyPerson]  FOREIGN KEY([iUserId]) REFERENCES [tblIMS_CompanyPerson] ([iId]) ;
GO


GO
 ALTER TABLE [tblIMS_NoteBook]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_NoteBook_tblIMS_CompanyPerson]  FOREIGN KEY([iUserId]) REFERENCES [tblIMS_CompanyPerson] ([iId]) ;
GO


GO
 ALTER TABLE [tblIMS_Options]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_Options_tblIMS_CompanyPerson]  FOREIGN KEY([iUserId]) REFERENCES [tblIMS_CompanyPerson] ([iId]) ;
GO


GO
 ALTER TABLE [tblIMS_Personnel]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_Personnel_tblIMS_CompanyPerson]  FOREIGN KEY([iUserId]) REFERENCES [tblIMS_CompanyPerson] ([iId]) ;
GO
 ALTER TABLE [tblIMS_Personnel]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_Personnel_tblIMS_CompanyUnit1]  FOREIGN KEY([iCompanyUnitCd]) REFERENCES [tblIMS_CompanyUnit] ([iCd]) ;
GO
 ALTER TABLE [tblIMS_Personnel]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_Personnel_tblIMS_Employ2]  FOREIGN KEY([iEmployId]) REFERENCES [tblIMS_Employ] ([iId]) ;
GO


GO
 ALTER TABLE [tblIMS_PersonnelAccess]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_PersonnelAccess_tblIMS_CompanyPerson]  FOREIGN KEY([iUserId]) REFERENCES [tblIMS_CompanyPerson] ([iId]) ;
GO


GO
 ALTER TABLE [tblIMS_PersonnelCartablAccess]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_PersonnelCartablAccess_tblIMS_CompanyPerson]  FOREIGN KEY([iUserId]) REFERENCES [tblIMS_CompanyPerson] ([iId]) ;
GO
 ALTER TABLE [tblIMS_PersonnelCartablAccess]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_PersonnelCartablAccess_tblIMS_Cartabl1]  FOREIGN KEY([iCartablId]) REFERENCES [tblIMS_Cartabl] ([iId]) ;
GO


GO
 ALTER TABLE [tblIMS_PersonnelDes]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_PersonnelDes_tblIMS_CompanyPerson]  FOREIGN KEY([iUserId]) REFERENCES [tblIMS_CompanyPerson] ([iId]) ;
GO


GO
 ALTER TABLE [tblIMS_PersonnelInternalTel]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_PersonnelInternalTel_tblIMS_CompanyPerson]  FOREIGN KEY([iUserId]) REFERENCES [tblIMS_CompanyPerson] ([iId]) ;
GO


GO
 ALTER TABLE [tblIMS_PersonnelManagerDes]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_PersonnelManagerDes_tblIMS_CompanyPerson]  FOREIGN KEY([iUserId]) REFERENCES [tblIMS_CompanyPerson] ([iId]) ;
GO


GO
 ALTER TABLE [tblIMS_PersonnelSalary]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_PersonnelSalary_tblIMS_CompanyPerson]  FOREIGN KEY([iUserId]) REFERENCES [tblIMS_CompanyPerson] ([iId]) ;
GO


GO
 ALTER TABLE [tblIMS_PersonnelStrap]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_PersonnelStrap_tblIMS_CompanyPerson]  FOREIGN KEY([iUserId]) REFERENCES [tblIMS_CompanyPerson] ([iId]) ;
GO
 ALTER TABLE [tblIMS_PersonnelStrap]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_PersonnelStrap_tblIMS_PersonnelSalary1]  FOREIGN KEY([iPersonnelSalaryId]) REFERENCES [tblIMS_PersonnelSalary] ([iId]) ;
GO


GO
 ALTER TABLE [tblIMS_PersonnelStrapGratuity]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_PersonnelStrapGratuity_tblIMS_PersonnelStrap]  FOREIGN KEY([iPersonnelStrapId]) REFERENCES [tblIMS_PersonnelStrap] ([iId]) ;
GO


GO
 ALTER TABLE [tblIMS_PersonnelStrapGratuityManual]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_PersonnelStrapGratuityManual_tblIMS_CompanyPerson]  FOREIGN KEY([iPId]) REFERENCES [tblIMS_CompanyPerson] ([iId]) ;
GO


GO


GO


GO
 ALTER TABLE [tblIMS_ProductCode]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_ProductCode_tblIMS_GroupComponentProduct]  FOREIGN KEY([ProductPointer]) REFERENCES [tblIMS_GroupComponentProduct] ([iId]) ;
GO


GO
 ALTER TABLE [tblIMS_ProductComponentR]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_ProductComponentR_tblIMS_GroupComponentProduct]  FOREIGN KEY([iProductId]) REFERENCES [tblIMS_GroupComponentProduct] ([iId]) ;
GO
 ALTER TABLE [tblIMS_ProductComponentR]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_ProductComponentR_tblIMS_GroupComponentProduct1]  FOREIGN KEY([iComponentId]) REFERENCES [tblIMS_GroupComponentProduct] ([iId]) ;
GO


GO


GO


GO


GO
 ALTER TABLE [tblIMS_Quarantine]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_Quarantine_tblIMS_CompanyPerson]  FOREIGN KEY([iUserId]) REFERENCES [tblIMS_CompanyPerson] ([iId]) ;
GO
 ALTER TABLE [tblIMS_Quarantine]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_Quarantine_tblIMS_CompanyPerson1]  FOREIGN KEY([iCPId]) REFERENCES [tblIMS_CompanyPerson] ([iId]) ;
GO
 ALTER TABLE [tblIMS_Quarantine]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_Quarantine_tblIMS_CompanyPerson2]  FOREIGN KEY([iPId]) REFERENCES [tblIMS_CompanyPerson] ([iId]) ;
GO


GO
 ALTER TABLE [tblIMS_Records]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_Records_tblIMS_City]  FOREIGN KEY([iCityCd]) REFERENCES [tblIMS_City] ([iCd]) ;
GO


GO


GO
 ALTER TABLE [tblIMS_UserAccess]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_UserAccess_tblIMS_CompanyPerson]  FOREIGN KEY([iUserId]) REFERENCES [tblIMS_CompanyPerson] ([iId]) ;
GO
 ALTER TABLE [tblIMS_UserAccess]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_UserAccess_tblIMS_CompanyPerson1]  FOREIGN KEY([iPId]) REFERENCES [tblIMS_CompanyPerson] ([iId]) ;
GO


GO
 ALTER TABLE [tblIMS_Vacation]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_Vacation_User]  FOREIGN KEY([UserId]) REFERENCES [User] ([TF_Id]) ;
GO


GO


GO


GO


GO
 ALTER TABLE [tblIMS_Work]  WITH CHECK ADD CONSTRAINT [FK_tblIMS_Work_tblIMS_GroupComponentProduct]  FOREIGN KEY([ProductId]) REFERENCES [tblIMS_GroupComponentProduct] ([iId]) ;
GO


GO


GO


GO


GO


GO


GO


GO
 ALTER TABLE [tblSTORE_DynamicNameLogoDetails]  WITH CHECK ADD CONSTRAINT [FK_tblSTORE_DynamicNameLogoDetails_tblSTORE_DynamicNameLogo]  FOREIGN KEY([CompanyName]) REFERENCES [tblSTORE_DynamicNameLogo] ([CompanyName]) ;
GO


GO
 ALTER TABLE [tblSTORE_DynamicShelf]  WITH CHECK ADD CONSTRAINT [FK_tblSTORE_DynamicShelf_tblSTORE_DynamicStores]  FOREIGN KEY([StoreID]) REFERENCES [tblSTORE_DynamicStores] ([StoreID]) ;
GO


GO


GO
 ALTER TABLE [tblSTORE_DynamicStoreOperator]  WITH CHECK ADD CONSTRAINT [FK_tblSTORE_DynamicStoreOperator_tblSTORE_DynamicStores]  FOREIGN KEY([StoreID]) REFERENCES [tblSTORE_DynamicStores] ([StoreID]) ;
GO


GO


GO


GO


GO


GO


GO


GO


GO
 ALTER TABLE [tblSTORE_PackFormDetails]  WITH CHECK ADD CONSTRAINT [FK_tblSTORE_PackFormDetails_tblSTORE_PackForm]  FOREIGN KEY([ParentFormID]) REFERENCES [tblSTORE_PackForm] ([FormID]) ;
GO


GO
 ALTER TABLE [tblSTORE_ProduceComponents]  WITH CHECK ADD CONSTRAINT [FK_tblSTORE_ProduceComponents_tblSTORE_ProduceForm]  FOREIGN KEY([ParentFormID]) REFERENCES [tblSTORE_ProduceForm] ([FormID]) ;
GO


GO


GO
 ALTER TABLE [tblSTORE_ProduceProduct]  WITH CHECK ADD CONSTRAINT [FK_tblSTORE_ProduceProduct_tblSTORE_ProduceForm]  FOREIGN KEY([ParentFormID]) REFERENCES [tblSTORE_ProduceForm] ([FormID]) ;
GO


GO
 ALTER TABLE [tblSTORE_ProduceStepPerson]  WITH CHECK ADD CONSTRAINT [FK_tblSTORE_ProduceStepPerson_tblSTORE_ProduceForm]  FOREIGN KEY([ParentFormID]) REFERENCES [tblSTORE_ProduceForm] ([FormID]) ;
GO


GO


GO
 ALTER TABLE [tblSTORE_SellFacturesDetails]  WITH CHECK ADD CONSTRAINT [FK_tblSTORE_SellFacturesDetails_tblSTORE_SellFacture]  FOREIGN KEY([ParentFactureID]) REFERENCES [tblSTORE_SellFacture] ([FormID]) ;
GO


GO


GO


GO


GO


GO
 ALTER TABLE [tblSTORE_StoreIOFactureDetails]  WITH CHECK ADD CONSTRAINT [FK_tblSTORE_StoreIOFactureDetails_tblSTORE_StoreIOFacture]  FOREIGN KEY([ParentFormID]) REFERENCES [tblSTORE_StoreIOFacture] ([FormID]) ;
GO


GO


GO


GO


GO


GO
 ALTER TABLE [TelsaFrameWork]  WITH CHECK ADD CONSTRAINT [FK_TelsaFrameWork_TelsaFrameWork]  FOREIGN KEY([MasterPointer]) REFERENCES [TelsaFrameWork] ([TF_Id]) ;
GO
 ALTER TABLE [TelsaFrameWork]  WITH CHECK ADD CONSTRAINT [FK_TelsaFrameWork_TelsaFrameWork1]  FOREIGN KEY([PropertyPointer]) REFERENCES [TelsaFrameWork] ([TF_Id]) ;
GO
 ALTER TABLE [TelsaFrameWork]  WITH CHECK ADD CONSTRAINT [FK_TelsaFrameWork_TelsaFrameWork2]  FOREIGN KEY([MainPointer]) REFERENCES [TelsaFrameWork] ([TF_Id]) ;
GO


GO
 ALTER TABLE [TF_Alarm]  WITH CHECK ADD CONSTRAINT [FK_TF_Alarm_TelsaFrameWork]  FOREIGN KEY([SenderProjectId]) REFERENCES [TelsaFrameWork] ([TF_Id]) ;
GO
 ALTER TABLE [TF_Alarm]  WITH CHECK ADD CONSTRAINT [FK_TF_Alarm_TelsaFrameWork1]  FOREIGN KEY([ReceiverProjectId]) REFERENCES [TelsaFrameWork] ([TF_Id]) ;
GO
 ALTER TABLE [TF_Alarm]  WITH CHECK ADD CONSTRAINT [FK_TF_Alarm_User2]  FOREIGN KEY([ToUserId]) REFERENCES [User] ([TF_Id]) ;
GO
 ALTER TABLE [TF_Alarm]  WITH CHECK ADD CONSTRAINT [FK_TF_Alarm_TelsaFrameWork3]  FOREIGN KEY([RunProjectId]) REFERENCES [TelsaFrameWork] ([TF_Id]) ;
GO


GO
 ALTER TABLE [TF_GeneralSetting]  WITH CHECK ADD CONSTRAINT [FK_TF_GeneralSetting_TelsaFrameWork]  FOREIGN KEY([TFPointer]) REFERENCES [TelsaFrameWork] ([TF_Id]) ;
GO


GO
 ALTER TABLE [TF_OfflineProcess]  WITH CHECK ADD CONSTRAINT [FK_TF_OfflineProcess_TelsaFrameWork]  FOREIGN KEY([TableIdPointer]) REFERENCES [TelsaFrameWork] ([TF_Id]) ;
GO


GO
 ALTER TABLE [TF_Licence]  WITH CHECK ADD CONSTRAINT [FK_TF_Licence_tblIMS_CompanyPerson]  FOREIGN KEY([CompanyPersonPointer]) REFERENCES [tblIMS_CompanyPerson] ([TF_Id]) ;
GO
 ALTER TABLE [TF_Licence]  WITH CHECK ADD CONSTRAINT [FK_TF_Licence_tblSTORE_SellFacture1]  FOREIGN KEY([FactorPointer]) REFERENCES [tblSTORE_SellFacture] ([TF_Id]) ;
GO


GO
 ALTER TABLE [TF_StatisticalData]  WITH CHECK ADD CONSTRAINT [FK_TF_StatisticalData_TF_Licence]  FOREIGN KEY([MachineCodePointer]) REFERENCES [TF_Licence] ([TF_Id]) ;
GO


GO
 ALTER TABLE [TF_TFCache]  WITH CHECK ADD CONSTRAINT [FK_TF_TFCache_TelsaFrameWork]  FOREIGN KEY([Command]) REFERENCES [TelsaFrameWork] ([TF_Id]) ;
GO
 ALTER TABLE [TF_TFCache]  WITH CHECK ADD CONSTRAINT [FK_TF_TFCache_TelsaFrameWork1]  FOREIGN KEY([InputPointer]) REFERENCES [TelsaFrameWork] ([TF_Id]) ;
GO
 ALTER TABLE [TF_TFCache]  WITH CHECK ADD CONSTRAINT [FK_TF_TFCache_TelsaFrameWork2]  FOREIGN KEY([InputRelationPointer]) REFERENCES [TelsaFrameWork] ([TF_Id]) ;
GO
 ALTER TABLE [TF_TFCache]  WITH CHECK ADD CONSTRAINT [FK_TF_TFCache_TelsaFrameWork3]  FOREIGN KEY([ResultPointer]) REFERENCES [TelsaFrameWork] ([TF_Id]) ;
GO
 ALTER TABLE [TF_TFCache]  WITH CHECK ADD CONSTRAINT [FK_TF_TFCache_TelsaFrameWork4]  FOREIGN KEY([TFData]) REFERENCES [TelsaFrameWork] ([Data]) ;
GO
 ALTER TABLE [TF_TFCache]  WITH CHECK ADD CONSTRAINT [FK_TF_TFCache_TelsaFrameWork5]  FOREIGN KEY([TFOrder]) REFERENCES [TelsaFrameWork] ([Order]) ;
GO


GO
 ALTER TABLE [TF_AutoUpdateLog]  WITH CHECK ADD CONSTRAINT [FK_TF_AutoUpdateLog_TF_Licence]  FOREIGN KEY([MachineCodePointer]) REFERENCES [TF_Licence] ([TF_Id]) ;
GO


GO
 ALTER TABLE [TF_AI]  WITH CHECK ADD CONSTRAINT [FK_TF_AI_tblSTORE_SellFacture]  FOREIGN KEY([FactorPointer]) REFERENCES [tblSTORE_SellFacture] ([TF_Id]) ;
GO


GO


GO


GO


GO


GO


GO


GO


GO
 ALTER TABLE [SecurityChannelAccess]  WITH CHECK ADD CONSTRAINT [FK_SecurityChannelAccess_SecurityUsers]  FOREIGN KEY([UserID]) REFERENCES [SecurityUsers] ([ID]) ;
GO


GO


GO


GO


GO


GO


GO


GO


GO


GO


GO


GO
 ALTER TABLE [tblHW64Config]  WITH CHECK ADD CONSTRAINT [FK_tblHW64Config_OfflineRecordServers]  FOREIGN KEY([RecorderServerPointer]) REFERENCES [OfflineRecordServers] ([TF_Id]) ;
GO


GO


GO
 ALTER TABLE [HZTbl_WithProperty_Article]  WITH CHECK ADD CONSTRAINT [FK_HZTbl_WithProperty_Article_HZRelationalTblAsMaster_DynamicProperty]  FOREIGN KEY([FK_DynamicProperty_Master]) REFERENCES [HZRelationalTblAsMaster_DynamicProperty] ([TF_Id]) ;
GO
 ALTER TABLE [HZTbl_WithProperty_Article]  WITH CHECK ADD CONSTRAINT [FK_HZTbl_WithProperty_Article_HZValidDataTbl_Template1]  FOREIGN KEY([FK_ValidData_Template]) REFERENCES [HZValidDataTbl_Template] ([TF_Id]) ;
GO
 ALTER TABLE [HZTbl_WithProperty_Article]  WITH CHECK ADD CONSTRAINT [FK_HZTbl_WithProperty_Article_HZValidDataTbl_Lable2]  FOREIGN KEY([FK_ValidData_Lable]) REFERENCES [HZValidDataTbl_Lable] ([TF_Id]) ;
GO
 ALTER TABLE [HZTbl_WithProperty_Article]  WITH CHECK ADD CONSTRAINT [FK_HZTbl_WithProperty_Article_HZValidDataTbl_Aligment3]  FOREIGN KEY([FK_ValidData_Aligment]) REFERENCES [HZValidDataTbl_Aligment] ([TF_Id]) ;
GO
 ALTER TABLE [HZTbl_WithProperty_Article]  WITH CHECK ADD CONSTRAINT [FK_HZTbl_WithProperty_Article_HZValidDataTbl_Template4]  FOREIGN KEY([FK_ValidData_Template]) REFERENCES [HZValidDataTbl_Template] ([TF_Id]) ;
GO
 ALTER TABLE [HZTbl_WithProperty_Article]  WITH CHECK ADD CONSTRAINT [FK_HZTbl_WithProperty_Article_HZValidDataTbl_Lable5]  FOREIGN KEY([FK_ValidData_Lable]) REFERENCES [HZValidDataTbl_Lable] ([TF_Id]) ;
GO
 ALTER TABLE [HZTbl_WithProperty_Article]  WITH CHECK ADD CONSTRAINT [FK_HZTbl_WithProperty_Article_HZValidDataTbl_Aligment6]  FOREIGN KEY([FK_ValidData_Aligment]) REFERENCES [HZValidDataTbl_Aligment] ([TF_Id]) ;
GO


GO
 ALTER TABLE [HZRelationalTbl_Link]  WITH CHECK ADD CONSTRAINT [FK_HZRelationalTbl_Link_HZTbl_WithProperty_Article]  FOREIGN KEY([FK_Article_AsMaster]) REFERENCES [HZTbl_WithProperty_Article] ([TF_Id]) ;
GO
 ALTER TABLE [HZRelationalTbl_Link]  WITH CHECK ADD CONSTRAINT [FK_HZRelationalTbl_Link_HZTbl_WithProperty_Article1]  FOREIGN KEY([FK_Article_AsDetail]) REFERENCES [HZTbl_WithProperty_Article] ([TF_Id]) ;
GO


GO
 ALTER TABLE [HZRelationalTbl_ShowLink]  WITH CHECK ADD CONSTRAINT [FK_HZRelationalTbl_ShowLink_HZTbl_WithProperty_Article]  FOREIGN KEY([FK_Article_AsMaster]) REFERENCES [HZTbl_WithProperty_Article] ([TF_Id]) ;
GO
 ALTER TABLE [HZRelationalTbl_ShowLink]  WITH CHECK ADD CONSTRAINT [FK_HZRelationalTbl_ShowLink_HZTbl_WithProperty_Article1]  FOREIGN KEY([FK_Article_AsDetail]) REFERENCES [HZTbl_WithProperty_Article] ([TF_Id]) ;
GO


GO
 ALTER TABLE [HZRelationalTbl_Menu]  WITH CHECK ADD CONSTRAINT [FK_HZRelationalTbl_Menu_HZTbl_WithProperty_Article]  FOREIGN KEY([FK_Article_AsMaster]) REFERENCES [HZTbl_WithProperty_Article] ([TF_Id]) ;
GO
 ALTER TABLE [HZRelationalTbl_Menu]  WITH CHECK ADD CONSTRAINT [FK_HZRelationalTbl_Menu_HZTbl_WithProperty_Article1]  FOREIGN KEY([FK_Article_AsDetail]) REFERENCES [HZTbl_WithProperty_Article] ([TF_Id]) ;
GO


GO
 ALTER TABLE [HZRelationalTbl_Socials]  WITH CHECK ADD CONSTRAINT [FK_HZRelationalTbl_Socials_HZTbl_WithProperty_Article]  FOREIGN KEY([FK_Article_AsMaster]) REFERENCES [HZTbl_WithProperty_Article] ([TF_Id]) ;
GO
 ALTER TABLE [HZRelationalTbl_Socials]  WITH CHECK ADD CONSTRAINT [FK_HZRelationalTbl_Socials_HZTbl_WithProperty_Article1]  FOREIGN KEY([FK_Article_AsDetail]) REFERENCES [HZTbl_WithProperty_Article] ([TF_Id]) ;
GO


GO
 ALTER TABLE [HZRelationalTbl_Icon]  WITH CHECK ADD CONSTRAINT [FK_HZRelationalTbl_Icon_HZTbl_WithProperty_Article]  FOREIGN KEY([FK_Article_AsMaster]) REFERENCES [HZTbl_WithProperty_Article] ([TF_Id]) ;
GO
 ALTER TABLE [HZRelationalTbl_Icon]  WITH CHECK ADD CONSTRAINT [FK_HZRelationalTbl_Icon_HZTbl_WithProperty_Article1]  FOREIGN KEY([FK_Article_AsDetail]) REFERENCES [HZTbl_WithProperty_Article] ([TF_Id]) ;
GO


GO
 ALTER TABLE [HZRelationalTbl_Pricelist]  WITH CHECK ADD CONSTRAINT [FK_HZRelationalTbl_Pricelist_HZTbl_WithProperty_Article]  FOREIGN KEY([FK_Article_AsMaster]) REFERENCES [HZTbl_WithProperty_Article] ([TF_Id]) ;
GO
 ALTER TABLE [HZRelationalTbl_Pricelist]  WITH CHECK ADD CONSTRAINT [FK_HZRelationalTbl_Pricelist_HZTbl_WithProperty_Article1]  FOREIGN KEY([FK_Article_AsDetail]) REFERENCES [HZTbl_WithProperty_Article] ([TF_Id]) ;
GO


GO
 ALTER TABLE [HZRelationalTblAsMaster_DynamicProperty]  WITH CHECK ADD CONSTRAINT [FK_HZRelationalTblAsMaster_DynamicProperty_HZValidDataTbl_Aligment]  FOREIGN KEY([FK_ValidData_Aligment]) REFERENCES [HZValidDataTbl_Aligment] ([TF_Id]) ;
GO


GO


GO
 ALTER TABLE [HZTbl_DetailOfRelation_Class]  WITH CHECK ADD CONSTRAINT [FK_HZTbl_DetailOfRelation_Class_HZRelationalTblAsMaster_DynamicProperty]  FOREIGN KEY([FK_DynamicProperty_Master]) REFERENCES [HZRelationalTblAsMaster_DynamicProperty] ([TF_Id]) ;
GO
 ALTER TABLE [HZTbl_DetailOfRelation_Class]  WITH CHECK ADD CONSTRAINT [FK_HZTbl_DetailOfRelation_Class_HZTbl_WithProperty_Article1]  FOREIGN KEY([FK_Article]) REFERENCES [HZTbl_WithProperty_Article] ([TF_Id]) ;
GO


GO


GO
 ALTER TABLE [HZRelationalTblMasterDetail_DynamicProperty]  WITH CHECK ADD CONSTRAINT [FK_HZRelationalTblMasterDetail_DynamicProperty_HZRelationalTblAsMaster_DynamicProperty]  FOREIGN KEY([FK_DynamicProperty_Master_AsMaster]) REFERENCES [HZRelationalTblAsMaster_DynamicProperty] ([TF_Id]) ;
GO
 ALTER TABLE [HZRelationalTblMasterDetail_DynamicProperty]  WITH CHECK ADD CONSTRAINT [FK_HZRelationalTblMasterDetail_DynamicProperty_HZRelationalTblAsDetail_DynamicProperty1]  FOREIGN KEY([FK_DynamicProperty_Detail_AsDetail]) REFERENCES [HZRelationalTblAsDetail_DynamicProperty] ([TF_Id]) ;
GO


GO
 ALTER TABLE [HZRelationalTbl_Article_DynamicProperty]  WITH CHECK ADD CONSTRAINT [FK_HZRelationalTbl_Article_DynamicProperty_HZTbl_WithProperty_Article]  FOREIGN KEY([FK_Article]) REFERENCES [HZTbl_WithProperty_Article] ([TF_Id]) ;
GO
 ALTER TABLE [HZRelationalTbl_Article_DynamicProperty]  WITH CHECK ADD CONSTRAINT [FK_HZRelationalTbl_Article_DynamicProperty_HZRelationalTblAsDetail_DynamicProperty1]  FOREIGN KEY([FK_DynamicProperty_Detail]) REFERENCES [HZRelationalTblAsDetail_DynamicProperty] ([TF_Id]) ;
GO


GO
 ALTER TABLE [HZValidDataTbl_Template]  WITH CHECK ADD CONSTRAINT [FK_HZValidDataTbl_Template_HZValidDataTbl_MediaAlignement]  FOREIGN KEY([FK_ValidData_MediaAlignement]) REFERENCES [HZValidDataTbl_MediaAlignement] ([TF_Id]) ;
GO


GO


GO
 ALTER TABLE [HZTbl_DetailOfRelation_TemplateStructure]  WITH CHECK ADD CONSTRAINT [FK_HZTbl_DetailOfRelation_TemplateStructure_HZValidDataTbl_TemplateStructure]  FOREIGN KEY([FK_ValidData_TemplateStructure]) REFERENCES [HZValidDataTbl_TemplateStructure] ([TF_Id]) ;
GO
 ALTER TABLE [HZTbl_DetailOfRelation_TemplateStructure]  WITH CHECK ADD CONSTRAINT [FK_HZTbl_DetailOfRelation_TemplateStructure_HZValidDataTbl_Aligment1]  FOREIGN KEY([FK_ValidData_Aligment]) REFERENCES [HZValidDataTbl_Aligment] ([TF_Id]) ;
GO
 ALTER TABLE [HZTbl_DetailOfRelation_TemplateStructure]  WITH CHECK ADD CONSTRAINT [FK_HZTbl_DetailOfRelation_TemplateStructure_HZValidDataTbl_Template2]  FOREIGN KEY([FK_ValidData_Template]) REFERENCES [HZValidDataTbl_Template] ([TF_Id]) ;
GO


GO


GO


GO
 ALTER TABLE [HZTbl_DetailOfRelation_Media]  WITH CHECK ADD CONSTRAINT [FK_HZTbl_DetailOfRelation_Media_HZTbl_WithProperty_Article]  FOREIGN KEY([FK_Article]) REFERENCES [HZTbl_WithProperty_Article] ([TF_Id]) ;
GO


GO
 ALTER TABLE [HZTbl_DetailOfRelation_Content]  WITH CHECK ADD CONSTRAINT [FK_HZTbl_DetailOfRelation_Content_HZTbl_WithProperty_Article]  FOREIGN KEY([FK_Article]) REFERENCES [HZTbl_WithProperty_Article] ([TF_Id]) ;
GO


GO
 ALTER TABLE [HZTbl_DetailOfRelation_Download]  WITH CHECK ADD CONSTRAINT [FK_HZTbl_DetailOfRelation_Download_HZTbl_WithProperty_Article]  FOREIGN KEY([FK_Article]) REFERENCES [HZTbl_WithProperty_Article] ([TF_Id]) ;
GO


GO
 ALTER TABLE [HZTbl_DetailOfRelation_Tag]  WITH CHECK ADD CONSTRAINT [FK_HZTbl_DetailOfRelation_Tag_HZTbl_WithProperty_Article]  FOREIGN KEY([FK_Article]) REFERENCES [HZTbl_WithProperty_Article] ([TF_Id]) ;
GO


GO

GO

GO

