首页 > 代码库 > 产品分类表

产品分类表

CREATE TABLE [dbo].[GoodsCategories](
    [ID] [int] NOT NULL,
    [ClassName] [nvarchar](20) NOT NULL,
    [ParentID] [int] NOT NULL,
    [Depth] [int] NOT NULL,
    [RootID] [int] NOT NULL,
    [Orders] [int] NOT NULL,
    [ParentIDPath] [nvarchar](max) NOT NULL,
    [AddTime] [datetime] NOT NULL,
    [ParentNamePath] [nvarchar](max) NOT NULL,
 CONSTRAINT [PK_GoodsCategories] PRIMARY KEY CLUSTERED
(
    [ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO

ALTER TABLE [dbo].[GoodsCategories] ADD  CONSTRAINT [DF_GoodsCategories_Depth]  DEFAULT ((0)) FOR [Depth]
GO

ALTER TABLE [dbo].[GoodsCategories] ADD  CONSTRAINT [DF_GoodsCategories_AddTime]  DEFAULT (getdate()) FOR [AddTime]
GO

EXEC sys.sp_addextendedproperty @name=N‘MS_Description‘, @value=http://www.mamicode.com/N‘主键‘ , @level0type=N‘SCHEMA‘,@level0name=N‘dbo‘, @level1type=N‘TABLE‘,@level1name=N‘GoodsCategories‘, @level2type=N‘COLUMN‘,@level2name=N‘ID‘
GO

EXEC sys.sp_addextendedproperty @name=N‘MS_Description‘, @value=http://www.mamicode.com/N‘类型名称‘ , @level0type=N‘SCHEMA‘,@level0name=N‘dbo‘, @level1type=N‘TABLE‘,@level1name=N‘GoodsCategories‘, @level2type=N‘COLUMN‘,@level2name=N‘ClassName‘
GO

EXEC sys.sp_addextendedproperty @name=N‘MS_Description‘, @value=http://www.mamicode.com/N‘父ID‘ , @level0type=N‘SCHEMA‘,@level0name=N‘dbo‘, @level1type=N‘TABLE‘,@level1name=N‘GoodsCategories‘, @level2type=N‘COLUMN‘,@level2name=N‘ParentID‘
GO

EXEC sys.sp_addextendedproperty @name=N‘MS_Description‘, @value=http://www.mamicode.com/N‘深度‘ , @level0type=N‘SCHEMA‘,@level0name=N‘dbo‘, @level1type=N‘TABLE‘,@level1name=N‘GoodsCategories‘, @level2type=N‘COLUMN‘,@level2name=N‘Depth‘
GO

EXEC sys.sp_addextendedproperty @name=N‘MS_Description‘, @value=http://www.mamicode.com/N‘分类的根节点‘ , @level0type=N‘SCHEMA‘,@level0name=N‘dbo‘, @level1type=N‘TABLE‘,@level1name=N‘GoodsCategories‘, @level2type=N‘COLUMN‘,@level2name=N‘RootID‘
GO

EXEC sys.sp_addextendedproperty @name=N‘MS_Description‘, @value=http://www.mamicode.com/N‘排序‘ , @level0type=N‘SCHEMA‘,@level0name=N‘dbo‘, @level1type=N‘TABLE‘,@level1name=N‘GoodsCategories‘, @level2type=N‘COLUMN‘,@level2name=N‘Orders‘
GO

EXEC sys.sp_addextendedproperty @name=N‘MS_Description‘, @value=http://www.mamicode.com/N‘父ID路径‘ , @level0type=N‘SCHEMA‘,@level0name=N‘dbo‘, @level1type=N‘TABLE‘,@level1name=N‘GoodsCategories‘, @level2type=N‘COLUMN‘,@level2name=N‘ParentIDPath‘
GO

EXEC sys.sp_addextendedproperty @name=N‘MS_Description‘, @value=http://www.mamicode.com/N‘添加时间‘ , @level0type=N‘SCHEMA‘,@level0name=N‘dbo‘, @level1type=N‘TABLE‘,@level1name=N‘GoodsCategories‘, @level2type=N‘COLUMN‘,@level2name=N‘AddTime‘
GO

EXEC sys.sp_addextendedproperty @name=N‘MS_Description‘, @value=http://www.mamicode.com/N‘父級路徑名稱‘ , @level0type=N‘SCHEMA‘,@level0name=N‘dbo‘, @level1type=N‘TABLE‘,@level1name=N‘GoodsCategories‘, @level2type=N‘COLUMN‘,@level2name=N‘ParentNamePath‘
GO

产品分类表