IF OBJECT_ID('PDV_VD_CONF_MERCK') IS NULL
BEGIN 
CREATE TABLE [DBO].[PDV_VD_CONF_MERCK](
	[CD_EMP] [INT] NOT NULL,
	[CD_FILIAL] [INT] NOT NULL,
	[CD_VD] [INT] NOT NULL,
	[STS_ENVIO] [TINYINT] NULL,
	[STS_ENVIO_DESC] [VARCHAR](100) NULL,
	[DT_HR_CAD] [DATETIME] NULL,
	[TIPO_DOC] [INT] NULL,
 CONSTRAINT [PDV_VD_CONF_MERK_PK] PRIMARY KEY CLUSTERED 
(
	[CD_EMP] ASC,
	[CD_FILIAL] ASC,
	[CD_VD] 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].[PDV_VD_CONF_MERCK] ADD  CONSTRAINT [DF_PDV_VD_CONF_MERCK_DT_HR_CAD]  DEFAULT (GETDATE()) FOR [DT_HR_CAD]


ALTER TABLE [DBO].[PDV_VD_CONF_MERCK] ADD  DEFAULT ((0)) FOR [TIPO_DOC]

END 




