Northwind Database (Document! X Sample)
AdventureWorks Database / Sales Schema / Sales.CreditCard Table
In This Topic
    Sales.CreditCard Table
    In This Topic
    Description
    Customer credit card information.
    Properties
    Creation Date27/10/2017 14:33
    File GroupPRIMARY
    Text File Group
    System Object
    Published for Replication
    Rows19118
    Data Space Used1,496.00 KB
    Index Space Used832.00 KB
    Columns
     Column NameDescriptionDatatypeLengthAllow NullsDefaultFormula
    Primary Key Primary key for CreditCard records.Integer4   
     Credit card name.VarWChar50   
     Credit card number.VarWChar25   
     Credit card expiration month.UnsignedTinyInt1   
     Credit card expiration year.SmallInt2   
     Date and time the record was last updated.DBTimeStamp4 
    (getdate())
     
    Indexes
    IndexDescriptionPrimaryUnique
    Unique nonclustered index. 
    Primary key (clustered) constraint
    Objects that depend on Sales.CreditCard
     Database ObjectObject TypeDescriptionDep Level
    iduSalesOrderDetail triggeriduSalesOrderDetailTriggerAFTER INSERT, DELETE, UPDATE trigger that inserts a row in the TransactionHistory table, updates ModifiedDate in SalesOrderDetail and updates the SalesOrderHeader.SubTotal column.3
    Sales.PersonCreditCard tableSales.PersonCreditCardTableCross-reference table mapping people to their credit card information in the CreditCard table. 1
    Sales.SalesOrderDetail tableSales.SalesOrderDetailTableIndividual products associated with a specific sales order. See SalesOrderHeader.2
    Sales.SalesOrderHeader tableSales.SalesOrderHeaderTableGeneral sales order information.1
    Sales.SalesOrderHeaderSalesReason tableSales.SalesOrderHeaderSalesReasonTableCross-reference table mapping sales orders to sales reason codes.3
    uSalesOrderHeader triggeruSalesOrderHeaderTriggerAFTER UPDATE trigger that updates the RevisionNumber and ModifiedDate columns in the SalesOrderHeader table.Updates the SalesYTD column in the SalesPerson and SalesTerritory tables.3
    Sales.vSalesPersonSalesByFiscalYears viewSales.vSalesPersonSalesByFiscalYearsViewUses PIVOT to return aggregated sales information for each sales representative.3
    SQL
    SET ANSI_NULLS ON
    SET QUOTED_IDENTIFIER ON
    CREATE TABLE [Sales].[CreditCard](
        [CreditCardID] [int] IDENTITY(1,1) NOT NULL,
        [CardType] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
        [CardNumber] [nvarchar](25) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
        [ExpMonth] [tinyint] NOT NULL,
        [ExpYear] [smallint] NOT NULL,
        [ModifiedDate] [datetime] NOT NULL,
     CONSTRAINT [PK_CreditCard_CreditCardID] PRIMARY KEY CLUSTERED 
    (
        [CreditCardID] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY]
    
    ALTER TABLE [Sales].[CreditCard] ADD  CONSTRAINT [DF_CreditCard_ModifiedDate]  DEFAULT (getdate()) FOR [ModifiedDate]
    See Also