a question about alter procedure

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi,
What does alter procedure really mean? When I want to create a stored
procedure, I look at the sql and instead of saying create procedure - which
is what I thought I was doing, it says "alter". I did read a litte about it,
but I'm still a little foggy on it. Can somebody explain it?

thanks!!!!
 
Hi there

Are you referring to the stored procedure in SQL Server? The Alter and
Create Procedure is basically almost similar. The difference is that, you use
alter if the stored procedure has already exist in the database. You can not
use alter procedure if the stored procedure has not already exist. It will
give you an error message.

On the other hand, the create procedure can only be run if the stored
procedure has not been created in the database. Well ... unless off course if
you drop the stored procedure first and then you can use the create procedure.

Hope that's helpful.

Lucas
 
Yes, this is for a sql server. Also, if I create a new stored procedure for
the first time it is new. So, why would it say "alter" and not create?
Hmmmm.....
 
When you say that you create a new stored procedure, do you use the Query
Analyzer template?

Lucas
 
Im just in the database window and create a new query in Access ( adp
project)...
Google for a message in this group by Jamie Collins Top Predicates
on 28 Jun 2006. He has ADO Create Procedure code. Copy his code
into a module and call it in the immediate window. I do not know
what Alter Procedure does. Seems like you would simply drop a
procedure and create a new one.
 
Hello,

If I understand it correctly, when you change from design view of stored
procedure to SQL view in a ADP, you see "alter procedure" other than
"create procedure". If it is incorrect, please let me know.

This behavior is as designed. When you change from design view, the SP is
saved into database. Therefore, you could only alter procedure from that
point. As Lucas mentioned, you could use the similar syntax in "alter
procedure" as that in "create procedure". If you don't add any table in
design view, and then change to SQL view, you shall see "create procedure"
instead.

You could refer to SQL books online for more details about "alter procedure"

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_
aa-az_72sl.asp

If anything is unclear, please let's know.

Best Regards,

Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

=====================================================


This posting is provided "AS IS" with no warranties, and confers no rights.
 
Back
Top