77 lines
3.6 KiB
Transact-SQL
77 lines
3.6 KiB
Transact-SQL
|
|
/****** Object: Table [dbo].[Manager_AccidentSortB] Script Date: 2021/8/10 19:59:36 ******/
|
|
SET ANSI_NULLS ON
|
|
GO
|
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
GO
|
|
|
|
SET ANSI_PADDING ON
|
|
GO
|
|
|
|
CREATE TABLE [dbo].[Manager_AccidentSortB](
|
|
[AccidentSortId] [nvarchar](50) NOT NULL,
|
|
[MonthReportId] [nvarchar](50) NULL,
|
|
[AccidentType] [nvarchar](50) NULL,
|
|
[TypeFlag] [char](1) NULL,
|
|
[Number] [int] NULL,
|
|
[TotalNum] [int] NULL,
|
|
[PersonNum] [int] NULL,
|
|
[TotalPersonNum] [int] NULL,
|
|
[LoseHours] [int] NULL,
|
|
[TotalLoseHours] [int] NULL,
|
|
[LoseMoney] [money] NULL,
|
|
[TotalLoseMoney] [money] NULL,
|
|
CONSTRAINT [PK_Manager_AccidentSortB] PRIMARY KEY CLUSTERED
|
|
(
|
|
[AccidentSortId] ASC
|
|
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
|
) ON [PRIMARY]
|
|
|
|
GO
|
|
|
|
SET ANSI_PADDING OFF
|
|
GO
|
|
|
|
ALTER TABLE [dbo].[Manager_AccidentSortB] WITH CHECK ADD CONSTRAINT [FK_Manager_AccidentSortB_Manager_MonthReport] FOREIGN KEY([MonthReportId])
|
|
REFERENCES [dbo].[Manager_MonthReportB] ([MonthReportId])
|
|
GO
|
|
|
|
ALTER TABLE [dbo].[Manager_AccidentSortB] CHECK CONSTRAINT [FK_Manager_AccidentSortB_Manager_MonthReport]
|
|
GO
|
|
|
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'主键' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Manager_AccidentSortB', @level2type=N'COLUMN',@level2name=N'AccidentSortId'
|
|
GO
|
|
|
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'月报告' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Manager_AccidentSortB', @level2type=N'COLUMN',@level2name=N'MonthReportId'
|
|
GO
|
|
|
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'事故类型' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Manager_AccidentSortB', @level2type=N'COLUMN',@level2name=N'AccidentType'
|
|
GO
|
|
|
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'类型标志(1-对应损失工时,2-对应损失金额)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Manager_AccidentSortB', @level2type=N'COLUMN',@level2name=N'TypeFlag'
|
|
GO
|
|
|
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'发生次数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Manager_AccidentSortB', @level2type=N'COLUMN',@level2name=N'Number'
|
|
GO
|
|
|
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'累计发生次数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Manager_AccidentSortB', @level2type=N'COLUMN',@level2name=N'TotalNum'
|
|
GO
|
|
|
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'损失工时(当月)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Manager_AccidentSortB', @level2type=N'COLUMN',@level2name=N'LoseHours'
|
|
GO
|
|
|
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'累计损失工时' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Manager_AccidentSortB', @level2type=N'COLUMN',@level2name=N'TotalLoseHours'
|
|
GO
|
|
|
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'损失金额' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Manager_AccidentSortB', @level2type=N'COLUMN',@level2name=N'LoseMoney'
|
|
GO
|
|
|
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'累计损失金额' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Manager_AccidentSortB', @level2type=N'COLUMN',@level2name=N'TotalLoseMoney'
|
|
GO
|
|
|
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'月报告事故分类表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Manager_AccidentSortB'
|
|
GO
|
|
|
|
|