error to the application in the homolog

0

Good morning,

I'm having a problem with the homolog version of the project

The index 'IX_ReqCompraId_Id' is dependent on column 'ReqCompraId'.
The object 'FK_dbo.Pedidos_dbo.ReqCompra_ReqCompraId' is dependent on column 'ReqCompraId'.
The object 'FK_dbo.Pedidos_dbo.ItemRC_ReqCompraId_Id' is dependent on column 'ReqCompraId'.
ALTER TABLE DROP COLUMN ReqCompraId failed because one or more objects access this column.

I have tried to do the following commands to rename id2 to id but continue unsuccessful

ALTER TABLE [dbo].[Pedidos] DROP CONSTRAINT [PK_dbo.Pedidos]
GO 


EXECUTE sp_rename @objname = N'dbo.Pedidos.Id2', @newname = N'Id', @objtype = N'COLUMN' 


ALTER TABLE [dbo].[Pedidos] ADD  CONSTRAINT [PK_dbo.Pedidos] PRIMARY KEY CLUSTERED 
(
    [Id] 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 



CREATE NONCLUSTERED INDEX [IX_ReqCompraId_Id] ON [dbo].[Pedidos]
(
    [ReqCompraId] ASC,
    [Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO 
    
asked by anonymous 26.06.2018 / 15:36

0 answers