Click to See Complete Forum and Search --> : newbie question on T-SQL


asafaa
November 29th, 2007, 06:00 AM
Hello,

i'm using my company Server and i want to add a stored procedure to the company SQL Server 2005.
i opened the stored procedures that are already in the DB and
i noticed that all the stored procedures start with the words :
"ALTER PROCEDURE"
and not "CREATE PROCEDURE".
Why is that?

CREATE PROCEDURE is the one that creates the procedure, not ALTER PROCEDURE that changes an existing one.....

KrisSimonis
November 29th, 2007, 07:04 AM
When you open an existing stored procedure in MS SQL 2005, it automagicly scripts it into an ALTER statement for you, so when you've finished altering it, you can just hit the button and you're done. :D
With MS SQL 2000, if you copied an existing stored procedure from the enterprise manager to the query analyzer, it would script it as a CREATE statement, so if you wanted to change it, you had to change the CREATE to ALTER. :wave:
If you wish to create a new stored procedure in MS SQL 2005, go to the database, programability, Stored procedures, and right click in the summary tab, then click 'new Stored procedure' for the templated MS SQL wizard thingie, or just go to the database and hit 'new query' then start typing. :eek:

asafaa
November 29th, 2007, 07:36 AM
Thanks!!