I am experiencing weird errors when trying to build the project from db solution.
EG. I have a table
CREATE TABLE [dbo].[partner2_log_status] (
[rec_id] INT IDENTITY (1, 1) NOT NULL,
[log_status] INT NULL,
[log_msg] NVARCHAR (4000) NULL,
[log_count] BIGINT CONSTRAINT [DF_partner2_log_status_log_count] DEFAULT ((0)) NOT NULL,
[sys_dt] DATETIME CONSTRAINT [DF_partner2_log_status_sys_dt] DEFAULT (getdate()) NOT NULL,
CONSTRAINT [PK_partner2_log_status] PRIMARY KEY CLUSTERED ([rec_id] ASC)
);
and this is what I'm getting :
SQL71508: The model already has an element that has the same name dbo.partner2_log_status.
SQL71501: Default Constraint: [dbo].[DF_partner2_log_status_log_count] has an unresolved reference to Column [dbo].[partner2_log_status].[log_count].
But there is only one table with this name in the project.
etc etc...
~1,7k errors in 10 projects.
This is happening across whole solution when I view/build in Visual Studio. SSMS accepts the code, and executes it successfully , so it seems to be a problem solely with VS.
What is happening, and how do I resolve it ?