CREATE TABLE  Client_Details (
            CDT_TaxIdentifier varchar(20) NOT NULL,
            CDT_LastName varchar(20) NOT NULL,
            CDT_FirstNameMI varchar(30) NULL,
            CDT_RepId varchar(20) NOT NULL,
	    CDT_ClientGroup varchar(8) NULL,
            CDT_ClientInActive bit null default 0,
	    CDT_DateClosed datetime Null,
            CDT_FormalTitle varchar(10) Null,
	    CDT_Salutation varchar(30) Null,
            CDT_DateOfBirth datetime Null,
            CDT_Citizenship varchar(4) Null,
            CDT_StateResidency varchar(4) Null,
	    CDT_Family varchar(40) Null,
	    CDT_FamilyMember varchar(2) Null,
            CDT_HomePhone varchar(20) Null,
	    CDT_WorkPhone varchar(20) Null,
	    CDT_CellPhone varchar(20) Null,
	    CDT_PrimaryAddress varchar(120) Null,
	    CDT_PrimaryCity varchar(20) Null,
	    CDT_PrimaryState varchar(20) Null,
	    CDT_PrimaryPostal varchar(10) Null,
            CDT_WorkAddress varchar(150) Null,
	    CDT_WorkCity varchar(20) Null,
	    CDT_WorkState varchar(20) Null,
	    CDT_WorkPostal varchar(10) Null,
	    CDT_Otheraddress varchar(150) Null,
	    CDT_OtherCity varchar(20) Null,
	    CDT_OtherState varchar(20) Null,
	    CDT_OtherPostal varchar(10) Null,
            CDT_HomeFax varchar(20) Null,
	    CDT_WorkFax varchar(20) Null,
	    CDT_OtherFax varchar(20) Null,
	    CDT_EMailA varchar(50) Null,
	    CDT_EMailB varchar(50) Null,
            CDT_TaxRateClass varchar(20) null,
	    CDT_TotalValue money Null,
	    CDT_UseAddressType tinyint null default 0,
	    CDT_SendRptToHomeFax bit null default 0,
	    CDT_SendRptToWorkFax bit null default 0,
	    CDT_SendRptToOtherFax bit null default 0,
	    CDT_SendRptToEmailA bit null default 0,
	    CDT_SendRptToEmailB bit null default 0,
            CDT_SendRptToPrinter bit null default 0,
            CDT_SendRptToEMail bit null default 0,
            CDT_SendRptToFax bit null default 0,
            CDT_UsePassword bit null default 0,
            CDT_ReportPwd varchar(15) Null,
            CDT_AttachmentType tinyint Null default 0,
	    CDT_ShortClientNotes varchar(512) Null,
            CDT_ProgCtrlBits integer null default 0,
	    CDT_TempRecord bit null default 0,
            CDT_IsFrozen  bit null default 0,
            CDT_UserDef1 varchar(50) null,
            CDT_UserDef2 varchar(50) null,
            CDT_UserDef3 varchar(50) null,
            CDT_UserDef4 varchar(50) null,
            CDT_UserDef5 varchar(50) null,
            CDT_UserDef6 varchar(50) null,
            CDT_UserDef7 varchar(50) null,
            CDT_UserDef8 varchar(50) null,
            CDT_UserDef9 varchar(50) null,
	    CDT_RepFeePct float Null,
            CONSTRAINT PK_Client_Details PRIMARY KEY CLUSTERED (CDT_TaxIdentifier)
);

ALTER TABLE [dbo].[Client_Details] ADD
	CONSTRAINT [FK_Client_Details_General_UserInfo] FOREIGN KEY
	(
		[CDT_RepId]
	) REFERENCES [dbo].[General_UserInfo] (
		[CUC_LoginName]
	) ON UPDATE CASCADE
