0
votes

I have a stored procedure in a Database Project. I am having errors for all the parameters in the stored procedure and I get an error

The model has an element that has the same name dbo.xyz

If I replace my CREATE PROCEDURE command with ALTER PROCEDURE, the errors are gone but according to my understanding that we shall always write CREATE PROCEDURE in the project and based on the target DB while publishing it will handle automatically whether to CREATE or ALTER.

Can someone help me please. I have also looked up some solutions which says that the Model.xml file contains old code which needs to be replaced. But my DB-Project folder don't have any file like that.

Any help is really appreciated. I am new in handling this database project.

1
If the database object exists then you can't CREATE is again. You have to drop the procedure to CREATE it again. Otherwise you can modify(alter) it using ALTER PROCEDUREVTi

1 Answers

2
votes

It should be CREATE PROCEDURE in a Database Project. If the error goes away when you change it to ALTER PROCEDURE then it sounds like it is already defined somewhere else in your project.

Check to see if ANY other object in your project is using that name already, including tables and views.