IF NOT EXISTS (SELECT * FROM SYS.TABLES WHERE NAME ='EST_NF_ENT_CHECKIN_ENTRADA_TEMP_CAB')
BEGIN 
CREATE TABLE [dbo].[EST_NF_ENT_CHECKIN_ENTRADA_TEMP_CAB](
	[CD_CTR] [int] IDENTITY(1,1) NOT NULL,
	[CD_EMP] [int] NOT NULL,
	[CD_FILIAL] [int] NOT NULL,
	[CD_USU] [int] NOT NULL,
	[DT_CAD] [datetime] NOT NULL,
 CONSTRAINT [PK_EST_NF_ENT_CHECKIN_ENTRADA_TEMP_CAB] PRIMARY KEY CLUSTERED 
(
	[CD_CTR] 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 [dbo].[EST_NF_ENT_CHECKIN_ENTRADA_TEMP_CAB] ADD  CONSTRAINT [DF_EST_NF_ENT_CHECKIN_ENTRADA_TEMP_CAB_CD_EMP]  DEFAULT ((1)) FOR [CD_EMP]

ALTER TABLE [dbo].[EST_NF_ENT_CHECKIN_ENTRADA_TEMP_CAB] ADD  CONSTRAINT [DF_EST_NF_ENT_CHECKIN_ENTRADA_TEMP_CAB_CD_FILIAL]  DEFAULT ((1)) FOR [CD_FILIAL]

ALTER TABLE [dbo].[EST_NF_ENT_CHECKIN_ENTRADA_TEMP_CAB] ADD  CONSTRAINT [DF_EST_NF_ENT_CHECKIN_ENTRADA_TEMP_CAB_CD_USU]  DEFAULT ((1)) FOR [CD_USU]

ALTER TABLE [dbo].[EST_NF_ENT_CHECKIN_ENTRADA_TEMP_CAB] ADD  CONSTRAINT [DF_EST_NF_ENT_CHECKIN_ENTRADA_TEMP_CAB_DT_CAD]  DEFAULT (getdate()) FOR [DT_CAD]
END