Issue with SQL Server saving Stored Procedure Changes

Jeff Dosser 21 Reputation points
2021-09-01T15:57:46.717+00:00

I'm having a troublesome issue with stored procedures on my SQL Server version 13.0.4001.0.
I've noticed this problems many times before, but it's become quite problematic.
Here is the scenario. Inside SQL Server, I open a stored procedure for edit. In this example,
If I make a change to the sproc code (example, commenting to lines), when I hit 'execute'
after making these changes, there are no errors and everything seems 'ok'.
However, regardless of how many times I 'refresh' and regardless at what 'level' I refresh,
sometimes the odds of the change actually being made in the sproc is less that 1/3.
I'm writing this message after 5 attempts to make a 'save' to an sproc after a simple change
of commenting out 2 lines.
I hit 'execute' multiple times, refreshed at all levels of the data base: the sproc itself, 'stored procedures'
'programmability and still the odds of the code change actually 'taking' are slim.

Any help much appreciated.

Developer technologies Transact-SQL
0 comments No comments
{count} votes

Accepted answer
  1. Tom Phillips 17,771 Reputation points
    2021-09-02T14:16:29.517+00:00

    What you are describing sounds like a problem in the version of SSMS you are using.

    Please update to the current version and retest.

    https://learn.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms?view=sql-server-ver15


2 additional answers

Sort by: Most helpful
  1. Erland Sommarskog 121.4K Reputation points MVP Volunteer Moderator
    2021-09-01T21:45:38.64+00:00

    First, you seem to be behind on the SQL Server version. I think that you have SQL 2016 SP1. The most recent build is SP2 CU16, so you would download first Service Pack 2 and then Cumulative Update 16. Not that it will change your problem.

    When you say that you are doing "refresh", what are you actually doing? Do you script the procedure anew in SSMS?

    What to you see if you run "sp_helptext yoursp" from a query window?

    0 comments No comments

  2. MelissaMa-MSFT 24,221 Reputation points
    2021-09-02T06:10:10.417+00:00

    Hi @Jeff Dosser ,

    Welcome to Microsoft Q&A!

    Where did you open a stored procedure for edit? Is it in the SSMS(SQL Server Management Studio)? If yes, what is the version of your SSMS?

    I tried with SSMS v17.4 and all comments did not show after right-clicking the procedure and clicking the Modify.

    But the comments remained in SSMS v18.5.

    You could upgrade your SSMS to latest version and have another try.

    Best regards,
    Melissa


    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.