[HELP] There is already an Object

01/01/2014 17:06 Zoas#1
Hello, I wanted to use the Ariez preunlock script but having a problem with it.

Code:
CREATE Proc usp_Read_User_MaxGrow_R

@ServerID tinyint,
@UserUID int

AS

SET NOCOUNT ON

IF NOT EXISTS(SELECT GROW FROM CHARS WHERE ServerID=@ServerID AND UserUID=@UserUID AND GROW <= 3 )
BEGIN
UPDATE UserMaxGrow SET MaxGrow = 3 WHERE ServerID=@ServerID AND UserUID=@UserUID AND Country <= 1
END

IF EXISTS(SELECT GROW FROM CHARS WHERE ServerID=@ServerID AND UserUID=@UserUID AND GROW = 3 AND LEVEL >= 0)
BEGIN
UPDATE UserMaxGrow SET MaxGrow = 3 WHERE ServerID=@ServerID AND UserUID=@UserUID
END

IF EXISTS(SELECT GROW FROM CHARS WHERE ServerID=@ServerID AND UserUID=@UserUID AND GROW = 3 AND LEVEL >= 0)
BEGIN
UPDATE UserMaxGrow SET MaxGrow = 3 WHERE ServerID=@ServerID AND UserUID=@UserUID
END

SELECT Country,MaxGrow FROM UserMaxGrow WHERE ServerID=@ServerID AND UserUID=@UserUID

SET NOCOUNT OFF
GO
It says in the first line (CREATE Proc usp_Read_User_MaxGrow_R)
There is already an object called 'usp_Read_User_MaxGrow_R' int the Database.
I don't know what to do now.
01/01/2014 21:05 TeddyBear94#2
u either deleate the existing one and run your script or you modify the existing one, which is the better way.
01/01/2014 22:11 Zoas#3
Thanks to you, easy short answer and at last it worked.
And thanks generally for answering. You have a good know how and you share it with the community. You've got my respect for that.
01/31/2014 17:18 elfamosoo#4
How can i delete the existing one ?
01/31/2014 17:23 nephren#5
PS_GameDefs (or PS_GameData, im not sure) > Programability > Stored Procedure > usp_Read_User_MaxGrow_R
Rightclick > Delete.