SALESORDERITEMSCENARIOSDONE
                                        Support table for auto apply discounts - Keeps track of scenarios that have been completed so they are not duplicated.  
                                        Primary Key
                                        
                                            
                                                
                                                    | Primary Key | Field Type | 
                                            
                                            
                                                
                                                    | ID | uniqueidentifier | 
                                            
                                        
                                        Fields
                                        
                                            
                                                
                                                    | Field | Field Type | Null | Notes | Description | 
                                            
                                            
                                                
                                                    | DISCOUNTSCENARIOID | uniqueidentifier |  |  | Foreign key to a discount scenario in the SALESORDERITEMDISCOUNTOPTION table. | 
                                                
                                                    | SALESORDERITEMID | uniqueidentifier |  |  | Foreign key to a SALESORDERITEM table. | 
                                                
                                                    | QUANTITY | int |  | Default = 0 | Number of order items in scenario. | 
                                                
                                                    | 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. | 
                                            
                                        
                                        Foreign Keys
                                        
                                            
                                                
                                                    | Foreign Key | Field Type | Null | Notes | Description | 
                                            
                                            
                                                
                                                    | SALESORDERID | uniqueidentifier |  | SALESORDER.ID | Foreign key to the SALESORDER table | 
                                                
                                                    | ADDEDBYID | uniqueidentifier |  | CHANGEAGENT.ID | FK to CHANGEAGENT. | 
                                                
                                                    | CHANGEDBYID | uniqueidentifier |  | CHANGEAGENT.ID | FK to CHANGEAGENT. | 
                                            
                                        
                                        Indexes
                                        
                                            
                                                
                                                    | Index Name | Fields | Unique | Primary | Clustered | 
                                            
                                            
                                                
                                                    | IX_SALESORDERITEMSCENARIOSDONE_DATEADDED | DATEADDED |  |  | yes | 
                                                
                                                    | IX_SALESORDERITEMSCENARIOSDONE_DATECHANGED | DATECHANGED |  |  |  | 
                                                
                                                    | IX_SALESORDERITEMSCENARIOSDONE_SALESORDERID | SALESORDERID |  |  |  | 
                                                
                                                    | PK_SALESORDERITEMSCENARIOSDONE | ID | yes | yes |  | 
                                            
                                        
                                        Triggers