ACCOUNTSTRUCTURE
                                        Accounting element definition  
                                        Primary Key
                                        
                                            
                                                
                                                    | Primary Key | Field Type | 
                                            
                                            
                                                
                                                    | ID | uniqueidentifier | 
                                            
                                        
                                        Fields
                                        
                                            
                                                
                                                    | Field | Field Type | Null | Notes | Description | 
                                            
                                            
                                                
                                                    | NAME | nvarchar(60) |  | Default = '' | User defined name of structure element | 
                                                
                                                    | LENGTH | tinyint |  | Default = 2 | Length of this structure element | 
                                                
                                                    | SEGMENTTYPECODE | tinyint |  | Default = 3 | Accounting Element type this structure element is associated with. Should match Accounting Element. | 
                                                
                                                    | SEGMENTTYPE | nvarchar(12) (Computed) | yes | CASE [SEGMENTTYPECODE] WHEN 1 THEN N'Account code' WHEN 2 THEN N'Fund' WHEN 3 THEN N'User-defined' WHEN 4 THEN N'Endowment' WHEN 5 THEN N'Program' WHEN 6 THEN N'Event' WHEN 7 THEN N'Project' WHEN 8 THEN N'Grant' WHEN 9 THEN N'Membership' END | Provides a translation for the 'SEGMENTTYPECODE' field. | 
                                                
                                                    | SEQUENCE | int |  | Default = 0 | Order this element appears in account string | 
                                                
                                                    | SEGMENTSEQUENCE | tinyint |  | Default = 0 | sequence just for account segments | 
                                                
                                                    | SEGMENTCOLUMN | tinyint |  | Default = 0 | Which column is the segment stored in for the account and transaction tables. | 
                                                
                                                    | ELEMENTTYPECODE | tinyint |  | Default = 1 | Account segment or transaction characteristic | 
                                                
                                                    | ELEMENTTYPE | nvarchar(26) (Computed) | yes | CASE [ELEMENTTYPECODE] WHEN 1 THEN N'Account segment' WHEN 2 THEN N'Transaction characteristic' END | Provides a translation for the 'ELEMENTTYPECODE' field. | 
                                                
                                                    | CLOSINGELEMENT | bit |  | Default = 0 | Is this a closing accounting element? | 
                                                
                                                    | DATEADDED | datetime |  | Default = getdate() | Indicates the date this record was added. | 
                                                
                                                    | DATECHANGED | datetime |  | Default = getdate() | Indicates the date this record was last changed. | 
                                                
                                                    | TS | timestamp |  |  | Timestamp. | 
                                                
                                                    | TSLONG | bigint (Computed) | yes | CONVERT(bigint, TS) | Numeric representation of the timestamp. | 
                                                
                                                    | DEFAULTDESCRIPTIONSEQUENCE | tinyint |  | Default = 0 | Sequence for default account description | 
                                                
                                                    | DEFAULTDESCRIPTIONLENGTH | tinyint |  | Default = 0 | Length for the default account description | 
                                                
                                                    | SEPARATORCODE | tinyint |  | Default = 1 | Separator to use between account segments. | 
                                                
                                                    | SEPARATOR | nvarchar(1) (Computed) | yes | CASE [SEPARATORCODE] WHEN 1 THEN N'-' WHEN 2 THEN N',' WHEN 3 THEN N'/' WHEN 4 THEN N';' WHEN 5 THEN N'.' END | Provides a translation for the 'SEPARATORCODE' field. | 
                                            
                                        
                                        Foreign Keys
                                        
                                            
                                                
                                                    | Foreign Key | Field Type | Null | Notes | Description | 
                                            
                                            
                                                
                                                    | SITEID | uniqueidentifier | yes | SITE.ID | Site this structure element is valid for | 
                                                
                                                    | ADDEDBYID | uniqueidentifier |  | CHANGEAGENT.ID | FK to CHANGEAGENT. | 
                                                
                                                    | CHANGEDBYID | uniqueidentifier |  | CHANGEAGENT.ID | FK to CHANGEAGENT. | 
                                            
                                        
                                        Indexes
                                        
                                            
                                                
                                                    | Index Name | Fields | Unique | Primary | Clustered | 
                                            
                                            
                                                
                                                    | IX_ACCOUNTSTRUCTURE_DATEADDED | DATEADDED |  |  | yes | 
                                                
                                                    | IX_ACCOUNTSTRUCTURE_DATECHANGED | DATECHANGED |  |  |  | 
                                                
                                                    | PK_ACCOUNTSTRUCTURE | ID | yes | yes |  | 
                                                
                                                    | UC_ACCOUNTSTRUCTURE_NAME | NAME | yes |  |  | 
                                                
                                                    | UIX_ACCOUNTSTRUCTURE_SITEID_NAME | SITEID, NAME | yes |  |  | 
                                            
                                        
                                        Triggers
                                        
                                        Referenced by