When I first used SQL Server 2005, I did not know how to save it after I modified the stored procedure.
In Progammability of SQL Server Management Studio, I find the corresponding stored procedure. Right-click and select "Modify". The editing window is displayed. After I Modify the content, click save, the "Save File As" dialog box appears. Let me select the saved path and File name, that is, Save it As another File, instead of directly saving the modified stored procedure. I don't know why I want to design it like this. I think most people will operate like me at the beginning. I have not found any other operation methods in SQL Server Management Studio. Really depressing!
Later, I found an article "Saving Stored Procedure" on the internet to know how to save the modified Stored Procedure. I used to click "Execute" (or press F5 ).
I thought this operation directly executed the stored procedure. Later, I found that when the "Modify" window is opened, the "ALTER" keyword will be added before the stored procedure. Therefore, when the "Execute" stored procedure is actually modifying the stored procedure, the SQL statement in the stored procedure is not executed. This reminds me of VS 2003 and VS 2005. When they are used to edit stored procedures, the "ALTER" keyword is also added before the stored procedure, but in VS 2003 and VS 2005, click the Save button to save the changes to the stored procedure. I think this design in SQL Server Management Studio is not very reasonable.
Source: dudu-happy programmer