Go
if exists (select * from sysobjects where id = OBJECT_ID('[EmployeeTerritories]') and OBJECTPROPERTY(id, 'IsUserTable') = 1) 
	DROP TABLE [EmployeeTerritories]
Go

CREATE TABLE [EmployeeTerritories] (
EmployeeID   int NOT NULL,           -- 雇员ID
TerritoryID  nvarchar(20) NOT NULL   -- 领域ID

CONSTRAINT [PK_EmployeeTerritories] PRIMARY KEY CLUSTERED ([EmployeeID])CONSTRAINT [PK_EmployeeTerritories] PRIMARY KEY CLUSTERED ([TerritoryID])
)
--添加表注释
exec sp_addextendedproperty N'MS_Description', N'雇员领域', N'user', N'dbo', N'table', N'EmployeeTerritories'

--添加列注释
exec sp_addextendedproperty N'MS_Description', N'雇员ID', N'user', N'dbo', N'table', N'EmployeeTerritories', N'column', N'EmployeeID'
exec sp_addextendedproperty N'MS_Description', N'领域ID', N'user', N'dbo', N'table', N'EmployeeTerritories', N'column', N'TerritoryID'
