IF NOT EXISTS (SELECT * FROM SYS.TABLES WHERE NAME = 'RC_CLI_ESTATIS_PENDENTE')
Begin
CREATE TABLE [dbo].[RC_CLI_ESTATIS_PENDENTE](
	[CD_EMP] [int] NOT NULL,
	[CD_CLI] [int] NOT NULL,
	[DT_CAD] [datetime] NOT NULL,
 CONSTRAINT [PK_RC_CLI_ESTATIS_PENDENTE] PRIMARY KEY CLUSTERED 
(
	[CD_EMP] ASC,
	[CD_CLI] 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].[RC_CLI_ESTATIS_PENDENTE] ADD  CONSTRAINT [DF_RC_CLI_ESTATIS_PENDENTE_CD_EMP]  DEFAULT ((0)) FOR [CD_EMP]

ALTER TABLE [dbo].[RC_CLI_ESTATIS_PENDENTE] ADD  CONSTRAINT [DF_RC_CLI_ESTATIS_PENDENTE_CD_CLI]  DEFAULT ((0)) FOR [CD_CLI]

ALTER TABLE [dbo].[RC_CLI_ESTATIS_PENDENTE] ADD  CONSTRAINT [DF_RC_CLI_ESTATIS_PENDENTE_DT_CAD]  DEFAULT (getdate()) FOR [DT_CAD]
end

