Aasim Shakil Pathan
Aasim Shakil Pathan

Reputation: 51

Visual Studio 2019 Schema Compare trying to add procedure that already exists

I am having this issue where Schema Compare in Visual Studio 2019 has detected that we don't have an SQL Stored Procedure and want to delete it from the live database, but if you can see the attached screenshot, we do have the stored procedure in Visual Studio SQL project.

If I compare the other way around, it tries to add the procedure to the project with a P_S_GetCaseAccountRolesAndCustomers**_1**.sql filename

False detection

Upvotes: 1

Views: 322

Answers (2)

Sam_I_Am
Sam_I_Am

Reputation: 1

In Solution Explorer, right click the object and open the properties for the object(s) giving you trouble. Check the "Build Action" and make sure it is set to "Build".

I had a handful of objects that were somehow set to "None" and experienced this exact behavior that you describe.

Upvotes: 0

JakeWu123
JakeWu123

Reputation: 1

This happens when your file (local) divert from the database (SSMS). For example, your stored procedure is now ALTER instead of CREATE.

Upvotes: 0

Related Questions