if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tblSafety_Log]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[tblSafety_Log]
GO
CREATE TABLE [dbo].[tblSafety_Log] (
[SS_Num] [int] NOT NULL Default 0 ,
[Emp_Num] [smallint] NOT NULL Default 0,
[Pos_Num] [smallint] NOT NULL Default 0,
[Insp_Date] [smalldatetime] NULL,
[Injury] [bit] Not null Default 0,
[I_Prev] [bit] Not null Default 0,
[I_NonPrev] [bit] Not null Default 0,
[I_Descrip] [varchar](50) Null,
[Accident] [bit] Not null Default 0,
[A_Prev] [bit] Not null Default 0,
[A_NonPrev] [bit] Not null Default 0,
[Ins_Report] [bit] Not null Default 0,
[Safety_Viol] [bit] Not null Default 0,
[ASV_Descrip] [varchar](50) Null,
[Lost_Tm] [bit] Not null Default 0
Primary Key (SS_Num)
) ON [PRIMARY]
GO
ASKER
ASKER
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tblSafety_Log]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[tblSafety_Log]
GO
CREATE TABLE [dbo].[tblSafety_Log] (
[SS_Num] [int] NOT NULL Default 0 ,
[Emp_Num] [smallint] NOT NULL Default 0,
[Pos_Num] [smallint] NOT NULL Default 0,
[Insp_Date] [smalldatetime] NULL,
[Injury] [bit] Not null Default 0,
[I_Prev] [bit] Not null Default 0,
[I_NonPrev] [bit] Not null Default 0,
[I_Descrip] [varchar](50) Null,
[Accident] [bit] Not null Default 0,
[A_Prev] [bit] Not null Default 0,
[A_NonPrev] [bit] Not null Default 0,
[Ins_Report] [bit] Not null Default 0,
[Safety_Viol] [bit] Not null Default 0,
[ASV_Descrip] [varchar](50) Null,
[Lost_Tm] [bit] Not null Default 0
Primary Key (SS_Num)
) ON [PRIMARY]
GO
-- add description extended property to the my_table_name table's 'id' column
EXEC sp_addextendedproperty 'MS_Description', 'EmpSS Last 6', 'user', dbo, 'table', 'tblSafety_Log', 'column', SS_Num
EXEC sp_addextendedproperty 'MS_Description', 'Employee Number', 'user', dbo, 'table', 'tblSafety_Log', 'column', Emp_Num
EXEC sp_addextendedproperty 'MS_Description', 'Position Number', 'user', dbo, 'table', 'tblSafety_Log', 'column', Pos_Num
EXEC sp_addextendedproperty 'MS_Description', 'Inspection Date', 'user', dbo, 'table', 'tblSafety_Log', 'column', Insp_Date
EXEC sp_addextendedproperty 'MS_Description', 'Injury Y/N', 'user', dbo, 'table', 'tblSafety_Log', 'column', Injury
EXEC sp_addextendedproperty 'MS_Description', 'Injury Preventable Y/N', 'user', dbo, 'table', 'tblSafety_Log', 'column', I_Prev
EXEC sp_addextendedproperty 'MS_Description', 'Injury Non-Preventable', 'user', dbo, 'table', 'tblSafety_Log', 'column', I_NonPrev
EXEC sp_addextendedproperty 'MS_Description', 'Injury Description', 'user', dbo, 'table', 'tblSafety_Log', 'column', I_Descrip
EXEC sp_addextendedproperty 'MS_Description', 'Accident Y/N', 'user', dbo, 'table', 'tblSafety_Log', 'column', Accident
EXEC sp_addextendedproperty 'MS_Description', 'Accident Preventable Y/N', 'user', dbo, 'table', 'tblSafety_Log', 'column', A_Prev
EXEC sp_addextendedproperty 'MS_Description', 'Accident Non-Preventable Y/N', 'user', dbo, 'table', 'tblSafety_Log', 'column', A_NonPrev
EXEC sp_addextendedproperty 'MS_Description', 'Insurance Report Y/N', 'user', dbo, 'table', 'tblSafety_Log', 'column', Ins_Report
EXEC sp_addextendedproperty 'MS_Description', 'Safety Violation Y/N', 'user', dbo, 'table', 'tblSafety_Log', 'column', Safety_Viol
EXEC sp_addextendedproperty 'MS_Description', 'Accident Safety Violation Description', 'user', dbo, 'table', 'tblSafety_Log', 'column', ASV_Descrip
EXEC sp_addextendedproperty 'MS_Description', 'Lost Time Y/N', 'user', dbo, 'table', 'tblSafety_Log', 'column', Lost_Tm
ASKER
Microsoft SQL Server is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.SQL Server is available in multiple versions, typically identified by release year, and versions are subdivided into editions to distinguish between product functionality. Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning.
TRUSTED BY
ASKER