Skip to main content
Merged

Make use of CREATE OR ALTER

Related products:Software Factory

The current way of editing a Stored Procedure returns the following method to create the syntax on the database:

if exists (select 1 from sysobjects
           where name = 'stored_proc_name' and type = 'P')
   drop procedure stored_proc_name
go

create procedure stored_proc_name
as
begin

However, when using Query Store, the relevant data will be untrackable as the object_id is different after creating.

A possible solution would be to make use of the 

CREATE OR ALTER dbo.stored_proc_name
AS
BEGIN

This makes sure the object_id isn't changing, so performance impact of the new version can be tracked more easy and if a specific plan is forced, this won't break.

Did this topic help you find an answer to your question?

2 replies

Mark Jongeling
Administrator
Forum|alt.badge.img+23
Updated idea statusNewDuplicate
Idea merged into:

All the votes from this idea have been transferred.

Mark Jongeling
Administrator
Forum|alt.badge.img+23

Hi Peter,

We have it on our backlog 😁


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings