Description
Properties
Creation Date | 27/10/2017 14:33 |
File Group | PRIMARY |
Text File Group | |
System Object | |
Published for Replication | |
Rows | 29 |
Data Space Used | 8.00 KB |
Index Space Used | 40.00 KB |
Columns
| Column Name | Description | Datatype | Length | Allow Nulls | Default | Formula |
| SalesTaxRateID | Primary key for SalesTaxRate records. | Integer | 4 | | | |
| StateProvinceID | State, province, or country/region the sales tax applies to. | Integer | 4 | | | |
| TaxType | 1 = Tax applied to retail transactions, 2 = Tax applied to wholesale transactions, 3 = Tax applied to all sales (retail and wholesale) transactions. | UnsignedTinyInt | 1 | | | |
| TaxRate | Tax rate amount. | Currency | 8 | | ((0.00)) | |
| Name | Tax rate description. | dbo.Name | 50 | | | |
| rowguid | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. | GUID | 16 | | (newid()) | |
| ModifiedDate | Date and time the record was last updated. | DBTimeStamp | 4 | | (getdate()) | |
Indexes
Check Constraints
Name | Description | Expression |
CK_SalesTaxRate_TaxType | Check constraint [TaxType] BETWEEN (1) AND (3) | ([TaxType]>=(1) AND [TaxType]<=(3)) |
Relationships
Objects that Sales.SalesTaxRate depends on
SQL
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
CREATE TABLE [Sales].[SalesTaxRate](
[SalesTaxRateID] [int] IDENTITY(1,1) NOT NULL,
[StateProvinceID] [int] NOT NULL,
[TaxType] [tinyint] NOT NULL,
[TaxRate] [smallmoney] NOT NULL,
[Name] [dbo].[Name] NOT NULL,
[rowguid] [uniqueidentifier] ROWGUIDCOL NOT NULL,
[ModifiedDate] [datetime] NOT NULL,
CONSTRAINT [PK_SalesTaxRate_SalesTaxRateID] PRIMARY KEY CLUSTERED
(
[SalesTaxRateID] 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].[SalesTaxRate] ADD CONSTRAINT [DF_SalesTaxRate_TaxRate] DEFAULT ((0.00)) FOR [TaxRate]
ALTER TABLE [Sales].[SalesTaxRate] ADD CONSTRAINT [DF_SalesTaxRate_rowguid] DEFAULT (newid()) FOR [rowguid]
ALTER TABLE [Sales].[SalesTaxRate] ADD CONSTRAINT [DF_SalesTaxRate_ModifiedDate] DEFAULT (getdate()) FOR [ModifiedDate]
ALTER TABLE [Sales].[SalesTaxRate] WITH CHECK ADD CONSTRAINT [FK_SalesTaxRate_StateProvince_StateProvinceID] FOREIGN KEY([StateProvinceID])
REFERENCES [Person].[StateProvince] ([StateProvinceID])
ALTER TABLE [Sales].[SalesTaxRate] CHECK CONSTRAINT [FK_SalesTaxRate_StateProvince_StateProvinceID]
ALTER TABLE [Sales].[SalesTaxRate] WITH CHECK ADD CONSTRAINT [CK_SalesTaxRate_TaxType] CHECK (([TaxType]>=(1) AND [TaxType]<=(3)))
ALTER TABLE [Sales].[SalesTaxRate] CHECK CONSTRAINT [CK_SalesTaxRate_TaxType]
|
See Also