When I first used SQL Server 2005, I didn't know how to save the stored procedure after modifying it.
I found the corresponding stored procedure in Progammability of SQL Server Management Studio, right-clicked and selected "Modify", which opened the editing window. After I modified it, I clicked Save, but the "Save File As" dialog box appeared, allowing me to choose The saved path and file name are saved as another file instead of directly saving the modified stored procedure. I don’t know why it is designed like this. I think most people will do it like me when they first start using it. I didn't find any other method in SQL Server Management Studio. It’s really depressing!
Later, I found an article "Saving Stored Procedure" on the Internet and found out how to save the modified stored procedure. It turned out that I clicked the "Execute" button (or pressed the F5 key).
Originally I thought this operation was to directly execute the stored procedure. Later I discovered that when the editing window is opened through "Modify", the "ALTER" keyword is added before the stored procedure, so when the stored procedure is passed through "Execute", the stored procedure is actually modified, and the SQL statement in the stored procedure is not executed. . This reminds me of VS 2003 and VS 2005. When editing a stored procedure through them, the "ALTER" keyword is also added before the stored procedure, but in VS 2003 and VS 2005, clicking the save button will directly save the stored procedure. Process modifications. I think this design in SQL Server Management Studio is not very reasonable.
Source: dudu-Happy Programmer