EMAILQUEUEGENERALPURPOSE
                                        Holds pending transactional emails. Since this is a queue, no audit trail is required.  
                                        Primary Key
                                        
                                            
                                                
                                                    | Primary Key | Field Type | 
                                            
                                            
                                                
                                                    | ID | uniqueidentifier | 
                                            
                                        
                                        Fields
                                        
                                            
                                                
                                                    | Field | Field Type | Null | Notes | Description | 
                                            
                                            
                                                
                                                    | MERGESQLVIEWID | uniqueidentifier | yes |  | This field references the SQLVIEWCATALOG table to indicate which view provides merge data for this email. | 
                                                
                                                    | EMAILHEADER | xml |  |  | Contains the email information (except for the body). Fields such as To, From, etc. with merge field placeholders. | 
                                                
                                                    | CONTENTTEXT | nvarchar(max) |  | Default = '' | Contains the email content information in text format with merge field placeholders. | 
                                                
                                                    | CONTENTHTML | nvarchar(max) |  | Default = '' | Contains the email content information in HTML format with merge field placeholders. | 
                                                
                                                    | PROCESSAFTERDATE | datetime |  | Default = getutcdate() | The earliest datetime to attempt to start processing the email job (used for scheduling emails) | 
                                                
                                                    | THREADID | uniqueidentifier |  |  | Contains a unique guid used to determine which emails are being processed by current loop. | 
                                                
                                                    | CHUNKPROCESSING | int |  | Default = 0 | Indicates merge data is in process of chunking so keep processing this email. | 
                                                
                                                    | MERGEROWSPROCESSED | int |  | Default = 0 | The number of merge rows processed. This number is used as recipient id info. | 
                                                
                                                    | MAXRETRYNUMBER | tinyint |  | Default = 3 | The maximum number of retries to attempt before the emailjob is rejected. | 
                                                
                                                    | RETRYNUMBER | tinyint |  | Default = 0 | Contains a 0 based number indicating which retry we are currently on. | 
                                                
                                                    | DATEADDEDTOQUEUE | datetime |  | Default = getdate() | Contains the date and time the email was added to the queue. This is needed since the Audit trail fields are not included. | 
                                                
                                                    | EXTERNALJOBIDENTITY | uniqueidentifier |  |  | Contains a guid that can be used to reference the job in an external email system. | 
                                                
                                                    | SOURCE | int |  | Default = 0 | Source id maps back to enum in emailservices.serviceclientbase | 
                                                
                                                    | CATEGORY | int |  | Default = 0 | The value of the category enum. | 
                                                
                                                    | MERGEDATASET | xml | yes |  | Contains XML representation of merge data set | 
                                                
                                                    | FIRSTPOLLSTARTED | bit |  | Default = 0 | Indicates if process has polled the job at least one time. | 
                                                
                                                    | LASTMERGEROWINPROCESSINGTABLE | uniqueidentifier | yes |  | The last guid added from the mergedata (unique row id) to the temporary processing table. | 
                                            
                                        
                                        Indexes
                                        
                                            
                                                
                                                    | Index Name | Fields | Unique | Primary | Clustered | 
                                            
                                            
                                                
                                                    | PK_EMAILQUEUEGENERALPURPOSE | ID | yes | yes | yes | 
                                            
                                        
                                        Referenced by