Modify stored procedure functionality is outputting the Alter stmt as dynamic SQL

Viewed 75

Just recently my SSMS changed and it's driving me crazy. Normally when you right click on a stored procedure and select "Modify", it outputs the stored procedure code as a bunch of SQL statements.

Starting yesterday, mine now outputs a giant sp_executesql statement (see screenshot). What setting controls this?? Using v 18.12.1

enter image description here

1 Answers

This is happening because of the existence check before the code creation of your procedure setting is enabled.

To control this behavior follow the steps.

  1. From the menu option, click "Tools > Options".
  2. On the left side, expand "SQL Server Object Explorer" and choose "Scripting"
  3. On the right-hand side, under the group "Object Scripting Options" change the setting "Check for object existence" to false.

enter image description here

Tested on v18.4

Related