Description
Cross-reference table mapping employees to their address(es).
Table properties
| name | value |
|---|
| name | [HumanResources].[EmployeeAddress] |
| created | Mar 19 2009 9:08PM |
| modified | Mar 19 2009 9:08PM
|
| ansi nulls | on
|
| quoted identifier | on
|
| row count | 290 |
| Size of data | 16 kb |
| Size of indexes | 32 kb |
| Maximum size of a single row | 32 bytes |
Columns
| column | datatype | length | bytes | default | nulls | PK | FK | UQ | computed | comment |
|---|
| EmployeeID | int | 10 | 4 | | no
| composite PK
| Employee.EmployeeID
|
| no
| Primary key. Foreign key to Employee.EmployeeID.
|
| AddressID | int | 10 | 4 | | no
| composite PK
| Address.AddressID
|
| no
| Primary key. Foreign key to Address.AddressID.
|
| rowguid | uniqueidentifier | 36 | 16 | (newid()) | no
|
| |
| no
| ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
|
| ModifiedDate | datetime | 23 | 8 | (getdate()) | no
|
| |
| no
| Date and time the record was last updated.
|
Indexes
| name | description | column | comment |
|---|
| AK_EmployeeAddress_rowguid | nonclustered, unique located on PRIMARY | rowguid | Unique nonclustered index. Used to support replication samples.
|
| PK_EmployeeAddress_EmployeeID_AddressID | clustered, unique, primary key located on PRIMARY | EmployeeID, AddressID | Clustered index created by a primary key constraint.
|
References
Foreign key graph
Foreign keys
| name | columns | foreign columns | type | comment |
|---|
| FK_EmployeeAddress_Address_AddressID | AddressID | Address.AddressID |
| Foreign key constraint referencing Address.AddressID.
|
| FK_EmployeeAddress_Employee_EmployeeID | EmployeeID | Employee.EmployeeID |
| Foreign key constraint referencing Employee.EmployeeID.
|
Defaults
Dependency graph
Objects that depend on [HumanResources].[EmployeeAddress]
Sample rows
| EmployeeID | AddressID | rowguid | ModifiedDate |
|---|
| 1
| 61
| 77253aef-8883-4e76-97aa-7b7dac21a2cd
| 10/13/2004 11:15:06 AM
|
| 2
| 234
| 7fa5ff71-e97b-457d-b7c4-88fb6566dc40
| 10/13/2004 11:15:06 AM
|
| 3
| 224
| 3c915b31-7c05-4a05-9859-0df663677240
| 10/13/2004 11:15:06 AM
|
| 4
| 11387
| 3dc70cc4-3ae8-424f-8b1f-481c5478e941
| 10/13/2004 11:15:06 AM
|
| 5
| 1
| 8aa698fc-090f-42ee-a197-2e7f7394d9f1
| 10/13/2004 11:15:06 AM
|
| 6
| 214
| 9cd92f26-342b-4af0-80e3-23fa079912b5
| 10/13/2004 11:15:06 AM
|
| 7
| 92
| f306c391-0d6b-43ae-9629-e50f56c01ec1
| 10/13/2004 11:15:06 AM
|
| 8
| 240
| 57a0819c-5d99-4d72-9340-653a14fefc8a
| 10/13/2004 11:15:06 AM
|
| 9
| 190
| c0ed2f68-937b-4594-9459-581ac53c98e3
| 10/13/2004 11:15:06 AM
|
| 10
| 56
| 80ad19f1-7d70-4fd6-864b-f0b3095188dd
| 10/13/2004 11:15:06 AM
|
Code
CREATE TABLE [HumanResources].[EmployeeAddress](
[EmployeeID] [int] NOT NULL,
[AddressID] [int] NOT NULL,
[rowguid] [uniqueidentifier] ROWGUIDCOL NOT NULL,
[EmployeeID] [int] NOT NULL,
[AddressID] [int] NOT NULL,
[ModifiedDate] [datetime] NOT NULL,
CONSTRAINT [PK_EmployeeAddress_EmployeeID_AddressID] PRIMARY KEY CLUSTERED
(
[EmployeeID] ASC,
[AddressID] 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 [HumanResources].[EmployeeAddress] WITH CHECK ADD CONSTRAINT [FK_EmployeeAddress_Address_AddressID] FOREIGN KEY([AddressID])
REFERENCES [Person].[Address] ([AddressID])
ALTER TABLE [HumanResources].[EmployeeAddress] CHECK CONSTRAINT [FK_EmployeeAddress_Address_AddressID]
ALTER TABLE [HumanResources].[EmployeeAddress] WITH CHECK ADD CONSTRAINT [FK_EmployeeAddress_Employee_EmployeeID] FOREIGN KEY([EmployeeID])
REFERENCES [HumanResources].[Employee] ([EmployeeID])
ALTER TABLE [HumanResources].[EmployeeAddress] CHECK CONSTRAINT [FK_EmployeeAddress_Employee_EmployeeID]
ALTER TABLE [HumanResources].[EmployeeAddress] ADD CONSTRAINT [DF_EmployeeAddress_rowguid] DEFAULT (newid()) FOR [rowguid]
ALTER TABLE [HumanResources].[EmployeeAddress] ADD CONSTRAINT [DF_EmployeeAddress_ModifiedDate] DEFAULT (getdate()) FOR [ModifiedDate]