Udostępnij za pośrednictwem


Typy danych w polu AdventureWorks

This topic lists the Microsoft .NET Framework CLR user-defined types, Microsoft SQL Server system data types, and Transact-SQL alias data types that are represented in the AdventureWorks sample database.

Środowisko CLR Typy definiowane przez użytkownika

W poniższej tabela przedstawiono przykłady w AdventureWorks wykorzystujących typy zdefiniowane przez użytkownika środowiska CLR. Aby uzyskać więcej informacji na temat środowiska CLR typów zdefiniowanych przez użytkownika Zobacz Środowisko CLR Typy definiowane przez użytkownika.

Przykład

Description

SQL Server Przykłady aparat bazy danych

Definiuje Waluta typ danych zdefiniowany przez użytkownika przy użyciu języka C#.Tego typu danych zdefiniowanego przez użytkownika obejmuje zarówno kwoty i kultury, który ułatwia analizowanie prawidłowy sposób, aby wyświetlić kwoty jako wartość waluty, w tym kultury.Przykład zawiera także funkcja konwersji waluty zwracającą wystąpienie Waluta typ zdefiniowany przez użytkownika.

UDT Utilities

Zawiera funkcje do wirtualny plik dziennika metadane w celu udostępnienia Transact-SQL: Przykładowe strumieniowych funkcji wycenione tabeli do zwracania typów w zestawie jako tabela i funkcji w celu zwrócenia pola, metody i właściwości w typ zdefiniowany przez użytkownika.

User-Defined Data Type (UDT) Sample

Pokazuje, tworzenie i stosowanie typu prostego danych zdefiniowanych przez użytkownika z obu Transact-SQL a aplikacja klient, który używa System.Data.SqlClient.

UTF8 String User-Defined Data Type (UDT)

Pokazuje implementacji typu danych zdefiniowanego przez użytkownika UTF-8, który rozszerza systemu typu bazy danych, aby zapewnić przechowywanie wartości kodowania UTF-8.Ten typ implementuje również kod do konwersji ciągów znaków Unicode i UTF-8.

Calendar-Aware Date/Time UDTs

Definiuje dwa typy danych zdefiniowane przez użytkownika, CADatetime and CADate, które zawierają obsługi kalendarza pamiętać daty i godziny.

Array Parameter Sample

Przekazuje tablicy informacji o kliencie składowana procedura CLR na serwerze przy użyciu typu danych zdefiniowanego przez użytkownika do środowiska CLR.

Typy danych systemowych

Następujące tabela list SQL Server System typów danych i tabel i kolumn, które ich używają. Aby uzyskać więcej informacji na temat typów danych systemu Zobacz Data Types (Transact-SQL).

Typ danych

W tym schema.tabela.kolumna

bigint

Nie używany.

bit

Zobacz Flagi and NameStyle w sekcji typów danych alias znajdujący się.

char lub nchar

HumanResources.Employee.Gender

HumanResources.Employee.MaritalStatus

Person.StateProvince.StateProvinceCode

Production.BillOfMaterials.UnitMeasureCode

Production.Culture.CultureID

Production.Document.Revision

Production.Product.Class

Production.Product.ProductLine

Production.Product.SizeUnitMeasureCode

Production.Product.Style

Production.Product.WeightUnitMeasureCode

Production.ProductModelProductDescriptionCulture.CultureID

Production.TransactionHistory.TransactionType

Production.TransactionHistoryArchive.TransactionType

Production.UnitMeasure.UnitMeasureCode

Purchasing.ProductVendor.UnitMeasureCode

Sales.CountryRegionCurrency.CurrencyCode

Sales.CurrencyRate.FromCurrencyCode

Sales.CurrencyRate.ToCurrencyCode

Sales.Customer.CustomerType

Sales.Currency.CurrencyCode

datetime

ModifiedDate wszystkie kolumna tabel podatku

dbo.AWBuildVersion.VersionDate

dbo.DatabaseLog.PostTime

HumanResources.Employee.BirthDate

HumanResources.Employee.HireDate

HumanResources.EmployeeDepartmentHistory.EndDate

HumanResources.EmployeeDepartmentHistory.StartDate

HumanResources.EmployeePayHistory.RateChangeDate

HumanResources.Shift.EndTime

HumanResources.Shift.StartTime

Production.BillOfMaterials.EndDate

Production.BillOfMaterials.StartDate

Production.Product.DiscontinuedDate

Production.Product.SellEndDate

Production.Product.SellStartDate

Production.ProductCostHistory.EndDate

Production.ProductCostHistory.StartDate

Production.ProductListPriceHistory.EndDate

Production.ProductListPriceHistory.StartDate

Production.TransactionHistory.TransactionDate

Production.TransactionHistoryArchive.TransactionDate

Production.WorkOrder.DueDate

Production.WorkOrder.EndDate

Production.WorkOrder.StartDate

Production.WorkOrderRouting.ActualEndDate

Production.WorkOrderRouting.ActualStartDate

Production.WorkOrderRouting.ScheduledEndDate

Production.WorkOrderRouting.ScheduledStartDate

Purchasing.ProductVendor.LastReceiptDate

Purchasing.PurchaseOrderDetail.DueDate

Purchasing.PurchaseOrderHeader.OrderDate

Purchasing.PurchaseOrderHeader.ShipDate

Sales.SalesCurrencyRate.CurrencyRateDate

Sales.SalesOrderHeader.DueDate

Sales.SalesOrderHeader.OrderDate

Sales.SalesOrderHeader.ShipDate

Sales.SalesPersonQuotaHistory.QuotaDate

Sales.SalesTerritoryHistory.EndDate

Sales.SalesTerritoryHistory.StartDate

Sales.ShoppingCartItem.DateCreated

Sales.SpecialOfferEndDate

Sales.SpecialOfferStartDate

decimal

Production.BillOfMaterials.PerAssemblyQty

Production.Location.Availability

Production.Product.weight

Purchasing.PurchaseOrderDetail.ReceivedQty

Purchasing.PurchaseOrderDetail.RejectedQty

Purchasing.PurchaseOrderDetail.StockedQty

Production.WorkOrderRouting.ActualResourcesHrs

float

Nie używany.

image

Nie używany.Zobacz varbinary(max).

int

Wszystkie tabele.

money

HumanResources.EmployeePayHistory.Rate

Production.Product.ListPrice

Production.Product.StandardCost

Production.ProductCostHistory.StandardCost

Production.ProductListPriceHistory.ListPrice

Production.TransactionHistory.ActualCost

Production.TransactionHistoryArchive.ActualCost

Production.WorkOrderRouting.PlannedCost

Production.WorkOrderRouting.ActualCost

Purchasing.ProductVendor.LastReceiptCost

Purchasing.ProductVendor.StandardPrice

Purchasing.PurchaseOrderDetail.LineTotal

Purchasing.PurchaseOrderDetail.UnitPrice

Purchasing.PurchaseOrderHeader.Freight

Purchasing.PurchaseOrderHeader.SubTotal

Purchasing.PurchaseOrderHeader.TaxAmt

Purchasing.PurchaseOrderHeader.TotalDue

Purchasing.ShipMethod.ShipBase

Purchasing.ShipMethod.ShipRate

Sales.CurrencyRate.AverageRate

Sales.CurrencyRate.EndOfDayRate

Sales.SalesOrderDetail.UnitPrice

Sales.SalesOrderDetail.UnitPriceDiscount

Sales.SalesOrderHeader.Freight

Sales.SalesOrderHeader.SubTotal

Sales.SalesOrderHeader.TaxAmt

Sales.SalesOrderHeader.TotalDue

Sales.SalesPerson.Bonus

Sales.SalesPerson.SalesLastYear

Sales.SalesPerson.SalesYTD

Sales.SalesPersonQuotaHistory.SalesQuota

Sales.SalesTerritory.CostLastYear

Sales.SalesTerritory.CostYTD

Sales.SalesTerritory.SalesLastYear

Sales.SalesTerritory.SalesYTD

numeric

Sales.SalesOrderDetail.LineTotal

smallint

HumanResources.Department.DepartmentID

HumanResources.Employee.SickLeaveHours

HumanResources.Employee.VacationHours

HumanResources.EmployeeDepartmentHistory.DepartmentID

Production.BillOfMaterials.BOMLevel

Production.Location.LocationID

Production.Product.SafetyStockLevel

Production.Product.ReorderPoint

Production.ProductInventory.Quantity

Production.ProductInventory.LocationID

Production.WorkOrder.ScrappedQty

Production.WorkOrder.ScrapReasonID

Production.WorkOrderRouting.OperationSequence

Production.WorkOrderRouting.LocationID

Purchasing.PurchaseOrderDetail.OrderQty

Sales.CreditCard.ExpYear

Sales.SalesOrderDetail.OrderQty

smallmoney

Production.Location.CostRate

Sales.SalesPerson.CommissionPct

Sales.SalesTaxRate.TaxRate

Sales.SpecialOffer.DiscountPct

sysname

dbo.DatabaseLog.DatabaseUser

dbo.DatabaseLog.zdarzenie

dbo.DatabaseLog.Schema

dbo.DatabaseLog.Object

text lub ntext

Nie używany.Zobacz varchar(max) lub nvarchar(max).

tinyint

dbo.AWBuildVersion.SystemInformationID

HumanResources.EmployeePayHistory.PayFrequency

HumanResources.EmployeeDepartmentHistory.ShiftID

HumanResources.EmployePayHistory.Rate

Production.Document.Status

Production.ProductInventory.Bin

Purchasing.PurchaseOrderHeader.RevisionNumber

Purchasing.PurchaseOrderHeader.Status

Purchasing.Vendor.CreditRating

Sales.CreditCard.ExpMonth

Sales.SalesOrderHeader.RevisionNumber

Sales.SalesOrderHeader.Status

Sales.SalesTaxRate.TaxType

Uniqueidentifier

IDENTYFIKATOR (GUID)

Zobacz kolumna ROWGUID w tabelach w schematach następujące:

  • Osoby

  • Sprzedaż

  • Produkt

W AdventureWorks, kolumna ROWGUID jest używana w próbie replikacja.

varbinary(max)

Production.Document.Document

Production.ProductPhoto.LargePhoto

Production.ProductPhoto.ThumbnailPhoto

varchar lub nvarchar

Wszystkie tabele.

varchar(max) lub

nvarchar(max)

Production.Document.DocumentSummary

dbo.DatabaseLog.TSQL

xml

dbo.DatabaseLog.XmlEvent

HumanResources.JobCandidate.Resume

Person.Contact.AdditionalContactInfo

Production.Illustration.Diagram

Production.ProductModel.CatalogDescription

Production.ProductModel.Instructions

Sales.Individual.Demographics

Sales.Store.Demographics

Typy danych alias

W poniższej tabela wymieniono typy danych alias, Transact-SQL typy danych zdefiniowane przez użytkownika, tabel i kolumn, które ich używają. Aby uzyskać więcej informacji na temat typów danych alias Zobacz Working with Alias Data Types.

Nazwa typu danych

Zdefiniowane jako

W tym schema.tabela.kolumna

AccountNumber

nvarchar(15)

Sales.SalesOrderHeader.AccountNumber

Purchasing.Vendor.AccountNumber

Flagi

bit

HumanResources.Employee.CurrentFlag

HumanResources.Employee.SalariedFlag

Person.StateProvince.IsOnlyStateProvinceFlag

Production.Product.FinishedGoodsFlag

Production.Product.MakeFlag

Production.ProductProductPhoto.Primary

Purchasing.Vendor.ActiveFlag

Purchasing.Vendor.PreferredVendorStatusFlag

Sales.SalesOrderHeader.OnlineOrderFlag

NameStyle

bit

Person.Contact.NameStyle

Imię i nazwisko

nvarchar(50)

HumanResources.Department.GroupName

HumanResources.Department.Name

HumanResources.Shift.Name

Person.AddressType.Name

Person.Contact.FirstName

Person.Contact.LastName

Person.Contact.MiddleName

Person.ContactType.Name

Person.CountryRegion.Name

Person.StateProvince.Name

Production.Culture.Name

Production.Location.Name

Production.Product.Name

Production.ProductCategory.Name

Production.ProductModel.Name

Production.ProductReview.ReviewerName

Production.ProductSubcategory.Name

Production.ScrapReason.Name

Production.UnitMeasure.Name

Purchasing.ShipMethod.Name

Purchasing.Vendor.Name

Sales.Currency.Name

Sales.SalesReason.Name

Sales.SalesReason.ReasonType

Sales.SalesTaxRate.Name

Sales.SalesTerritory.Name

Sales.Store.Name

OrderNumber

nvarchar(25)

Sales.SalesOrderHeader.SalesOrderNumber

Telefon

nvarchar(25)

Person.Contact.Phone