IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[EST_PROD_TRANSF_SOLICITACAO_RC_CLI]') AND name = N'IX_EST_PROD_TRANSF_SOLICITACAO_RC_CLI')
begin
	ALTER TABLE [dbo].[EST_PROD_TRANSF_SOLICITACAO_RC_CLI] DROP CONSTRAINT [IX_EST_PROD_TRANSF_SOLICITACAO_RC_CLI]
end
go
IF not OBJECT_ID('PK_EST_PROD_TRANSF_SOLICITACAO_RC_CLI') IS NULL
begin
	ALTER TABLE [dbo].[EST_PROD_TRANSF_SOLICITACAO_RC_CLI] DROP CONSTRAINT [PK_EST_PROD_TRANSF_SOLICITACAO_RC_CLI]
end
go
IF  EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_EST_PROD_TRANSF_SOLICITACAO_RC_CLI_EST_PROD_TRANSF_SOLICITACAO]'))
begin
	ALTER TABLE [dbo].[EST_PROD_TRANSF_SOLICITACAO_RC_CLI] DROP CONSTRAINT [FK_EST_PROD_TRANSF_SOLICITACAO_RC_CLI_EST_PROD_TRANSF_SOLICITACAO]
end
go
ALTER TABLE [dbo].[EST_PROD_TRANSF_SOLICITACAO_RC_CLI] ADD  CONSTRAINT [PK_EST_PROD_TRANSF_SOLICITACAO_RC_CLI] PRIMARY KEY CLUSTERED 
(
	[CD_CTR] ASC,
	[CD_EMP] ASC,
	[CD_CLI] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]

go
ALTER TABLE [dbo].[EST_PROD_TRANSF_SOLICITACAO_RC_CLI]  WITH CHECK ADD  CONSTRAINT [FK_EST_PROD_TRANSF_SOLICITACAO_RC_CLI_EST_PROD_TRANSF_SOLICITACAO] FOREIGN KEY([CD_CTR])
REFERENCES [dbo].[EST_PROD_TRANSF_SOLICITACAO] ([CD_CTR])
go
ALTER TABLE [dbo].[EST_PROD_TRANSF_SOLICITACAO_RC_CLI] CHECK CONSTRAINT [FK_EST_PROD_TRANSF_SOLICITACAO_RC_CLI_EST_PROD_TRANSF_SOLICITACAO]
go
ALTER TABLE [dbo].[EST_PROD_TRANSF_SOLICITACAO_RC_CLI] ADD  CONSTRAINT [IX_EST_PROD_TRANSF_SOLICITACAO_RC_CLI] UNIQUE NONCLUSTERED 
(
	[CD_CLI] ASC,
	[CD_EMP] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]

