'SQL Server stored procedures don't refresh even after refresh

Anytime I'm editing and debugging a SQL Server stored procedure, I'll make the changes, then refresh all along the line. I'll refresh folders: Stored Procedures, Programmability, the DB itself, all the way up to the server.

Regardless of how far up I refresh, when I click on the changed procedure, and no, I don't need to post examples of 'which' stored procedure or the code, it does this every time on any changes regardless of type.

But, when I right click on the stored procedure and say, 'Execute Stored Procedure', it always runs on the 'unchanged' code.

It takes 3 or 4 clicks on the 'Debug' button and a check of the code before the 'changed' code suddenly appears.

There seems no rhyme or reason for when the app refreshes with the edited changes, usually 3 or 4 reruns of 'Debug'.

This isn't a huge issue, just a very time consuming one.

Does anyone know how to make the dang thing refresh the 1st time? Without having to re-debug over and over and check the content for changes each time before I know they 'took'?



Solution 1:[1]

I try to use the option with recompile in the SP, and some time works,

ALTER PROCEDURE [dbo].[xx] (
    @pC_IDLEGAJO char(9),
   ....
    @P_MensajeError VarChar(500) output
)
WITH RECOMPILE 

But, finally a drop it

IF exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[NombreStored]') 
    and OBJECTPROPERTY(id, N'IsProcedure') = 1)
    drop procedure [dbo].[NombreStored];

Create procedure NombreStored ....

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Larnu