Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SQL Renaming Stored Procedures

Author  Topic 

sqlfresher
Starting Member

1 Post

Posted - 2005-12-26 : 07:18:41
Hi guys,

when i change a stored procedure definition, and recompile it says, object already exists. I can change the definition of procedure by first deleting the procedure with the same name and then compile. but i do not want to do that. How can i compile a stored procedure if i have changed its definition after it has been already compiled.

Very frustated

Vijay Koul

sachinsamuel
Constraint Violating Yak Guru

383 Posts

Posted - 2005-12-26 : 07:33:10
Welcome to SQLTeam.

Use alter command to change the definition.

Alter procedure <procedure name>
as
Print 'Hello World'
go

Regards
Sachin

Don't sit back because of failure. It will come back to check if you still available. -- Binu
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-12-26 : 07:49:28
As said you need to alter the sp and you dont have to drop and create again

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -