WideWorldImporters
Sales.CustomerTransactions
//
All financial transactions that are customer-related
Created: Modified:
Columns
-
//${escapify(column.description)}[int] NOT NULL DEFAULT (NEXT VALUE FOR [Sequences].[TransactionID])
-
//${escapify(column.description)}[int] NOT NULL
-
//${escapify(column.description)}[int] NOT NULL
-
//${escapify(column.description)}[int] NULL
-
//${escapify(column.description)}[int] NULL
-
//${escapify(column.description)}[date] NOT NULL
-
//${escapify(column.description)}[decimal](18, 2) NOT NULL
-
//${escapify(column.description)}[decimal](18, 2) NOT NULL
-
//${escapify(column.description)}[decimal](18, 2) NOT NULL
-
//${escapify(column.description)}[decimal](18, 2) NOT NULL
-
//${escapify(column.description)}[date] NULL
-
//${escapify(column.description)}[bit] NULL
-
[int] NOT NULL
-
[datetime2](8) NOT NULL DEFAULT (sysdatetime())
Indexes
-
CX_Sales_CustomerTransactionsCLUSTEREDTransactionDate
-
//Auto-created to support a foreign keyFK_Sales_CustomerTransactions_CustomerIDNONCLUSTEREDCustomerID , TransactionDate
-
//Auto-created to support a foreign keyFK_Sales_CustomerTransactions_TransactionTypeIDNONCLUSTEREDTransactionTypeID , TransactionDate
-
//Auto-created to support a foreign keyFK_Sales_CustomerTransactions_InvoiceIDNONCLUSTEREDInvoiceID , TransactionDate
-
//Auto-created to support a foreign keyFK_Sales_CustomerTransactions_PaymentMethodIDNONCLUSTEREDPaymentMethodID , TransactionDate
-
//Allows quick location of unfinalized transactionsIX_Sales_CustomerTransactions_IsFinalizedNONCLUSTEREDIsFinalized , TransactionDate
-
PK_Sales_CustomerTransactionsUNIQUE NONCLUSTEREDCustomerTransactionID
Foreign Keys
-
FK_Sales_CustomerTransactions_Application_PeopleApplication.PeopleLastEditedBy ⥱ PersonID
-
FK_Sales_CustomerTransactions_CustomerID_Sales_CustomersSales.CustomersCustomerID ⥱ CustomerID
-
FK_Sales_CustomerTransactions_InvoiceID_Sales_InvoicesSales.InvoicesInvoiceID ⥱ InvoiceID
-
FK_Sales_CustomerTransactions_PaymentMethodID_Application_PaymentMethodsApplication.PaymentMethodsPaymentMethodID ⥱ PaymentMethodID
-
FK_Sales_CustomerTransactions_TransactionTypeID_Application_TransactionTypesApplication.TransactionTypesTransactionTypeID ⥱ TransactionTypeID
Sample Data
CustomerTransactionID
CustomerID
TransactionTypeID
InvoiceID
PaymentMethodID
TransactionDate
AmountExcludingTax
TaxAmount
TransactionAmount
OutstandingBalance
FinalizationDate
IsFinalized
LastEditedBy
LastEditedWhen
2
832
1
1
NULL
2300
345
2645
NULL
true
10
5
803
1
2
NULL
405
60.75
465.75
NULL
true
10
7
1
1
3
NULL
90
13.5
103.5
NULL
true
10
11
1
1
4
NULL
445.2
66.78
511.98
NULL
true
10
15
905
1
5
NULL
704
105.6
809.6
NULL
true
10
19
976
1
6
NULL
430
64.5
494.5
NULL
true
10
24
401
1
7
NULL
603.5
90.53
694.03
NULL
true
10
28
964
1
8
NULL
258
38.7
296.7
NULL
true
10
31
1
1
9
NULL
178
26.7
204.7
NULL
true
10
34
1
1
10
NULL
104
15.6
119.6
NULL
true
10
36
401
1
11
NULL
13
1.95
14.95
NULL
true
10
39
401
1
12
NULL
229
34.35
263.35
NULL
true
10
42
401
1
13
NULL
2430
364.5
2794.5
NULL
true
10
46
870
1
14
NULL
650
97.5
747.5
NULL
true
10
49
991
1
15
NULL
174
26.1
200.1
NULL
true
10
51
401
1
16
NULL
68
10.2
78.2
NULL
true
10
54
910
1
17
NULL
424
63.6
487.6
NULL
true
10
56
949
1
18
NULL
91
13.65
104.65
NULL
true
10
60
973
1
19
NULL
3185
477.75
3662.75
NULL
true
10
62
884
1
20
NULL
240
36
276
NULL
true
10
66
1
1
21
NULL
535
80.25
615.25
NULL
true
10
69
890
1
22
NULL
3182
477.3
3659.3
NULL
true
10
73
1
1
23
NULL
1490
223.5
1713.5
NULL
true
10
76
873
1
24
NULL
472
70.8
542.8
NULL
true
10
79
401
1
25
NULL
129
19.35
148.35
NULL
true
10