Apply naming convention policy to only new store procedures

  • Hello,

    I am trying to set up naming convention policies against an older DB. The DB is kind of messy and the SP have a lot of different names. I wanted to set up a policy that would require all SP's in that DB to start with spSFT_. I made the policy and added the constraints put the evaluation mode to 'On change: prevent'. That's the easy part.

    The problem I ran into is when I go to modify an old SP. The old SP violates the policy and won't let me change the SP. There are a lot of SP's and a lot of code. I wanted to just apply this to only new SPs.

    I tried adding the constraint @createdate = getdate() but that didn't work.

    Anyone have any ideas?

  • For the condition I added

    @Name Like 'sft_sp%'

    Or

    @CreatedDate < DateAdd('mi', -5, GetDate()) -- it was created more than 5 mins ago.

    It seems to work.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply