Why SP_Naming policy still blocked my correct creating?

Are the IPv6 address space and IPv4 address space completely disjoint?

Why is it that I can sometimes guess the next note?

Where did Heinlein say "Once you get to Earth orbit, you're halfway to anywhere in the Solar System"?

Not using 's' for he/she/it

Store Credit Card Information in Password Manager?

Loading commands from file

why `nmap 192.168.1.97` returns less services than `nmap 127.0.0.1`?

GraphicsGrid with a Label for each Column and Row

Create all possible words using a set or letters

Why is so much work done on numerical verification of the Riemann Hypothesis?

WiFi Thermostat, No C Terminal on Furnace

Multiplicative persistence

Argument list too long when zipping large list of certain files in a folder

When a Cleric spontaneously casts a Cure Light Wounds spell, will a Pearl of Power recover the original spell or Cure Light Wounds?

Can someone explain how this makes sense electrically?

What are the purposes of autoencoders?

How to indicate a cut out for a product window

How can Trident be so inexpensive? Will it orbit Triton or just do a (slow) flyby?

How can "mimic phobia" be cured or prevented?

What should you do when eye contact makes your subordinate uncomfortable?

Should I stop contributing to retirement accounts?

Offered money to buy a house, seller is asking for more to cover gap between their listing and mortgage owed

Is it better practice to read straight from sheet music rather than memorize it?

Non-trope happy ending?



Why SP_Naming policy still blocked my correct creating?














0















I used PBM to manage my policy against my user DBs.
The Condition is:



Declare @condition_id int
EXEC msdb.dbo.sp_syspolicy_add_condition @name=N'SP_Naming_convention', @description=N'', @facet=N'StoredProcedure', @expression=N'<Operator>
<TypeClass>Bool</TypeClass>
<OpType>LIKE</OpType>
<Count>2</Count>
<Attribute>
<TypeClass>String</TypeClass>
<Name>Name</Name>
</Attribute>
<Constant>
<TypeClass>String</TypeClass>
<ObjType>System.String</ObjType>
<Value>usp_%</Value>
</Constant>
</Operator>', @is_name_condition=2, @obj_name=N'usp_%', @condition_id=@condition_id OUTPUT
Select @condition_id

GO


The policy is:



Declare @object_set_id int
EXEC msdb.dbo.sp_syspolicy_add_object_set @object_set_name=N'SP_Naming_ObjectSet', @facet=N'StoredProcedure', @object_set_id=@object_set_id OUTPUT
Select @object_set_id

Declare @target_set_id int
EXEC msdb.dbo.sp_syspolicy_add_target_set @object_set_name=N'SP_Naming_ObjectSet', @type_skeleton=N'Server/Database/StoredProcedure', @type=N'PROCEDURE', @enabled=True, @target_set_id=@target_set_id OUTPUT
Select @target_set_id

EXEC msdb.dbo.sp_syspolicy_add_target_set_level @target_set_id=@target_set_id, @type_skeleton=N'Server/Database/StoredProcedure', @level_name=N'StoredProcedure', @condition_name=N'', @target_set_level_id=0
EXEC msdb.dbo.sp_syspolicy_add_target_set_level @target_set_id=@target_set_id, @type_skeleton=N'Server/Database', @level_name=N'Database', @condition_name=N'', @target_set_level_id=0


GO

Declare @policy_id int
EXEC msdb.dbo.sp_syspolicy_add_policy @name=N'SP_Naming', @condition_name=N'SP_Naming_convention', @policy_category=N'', @description=N'Get out of my box you DEV!', @help_text=N'Stop doing this!', @help_link=N'', @schedule_uid=N'00000000-0000-0000-0000-000000000000', @execution_mode=1, @is_enabled=True, @policy_id=@policy_id OUTPUT, @root_condition_name=N'', @object_set=N'SP_Naming_ObjectSet'
Select @policy_id


GO


I tried to create an SP named usp_whatever:



create proc usp_whatever
as
begin
select @@VERSION
end


But the policy still blocked mine...
Any thought? Thanks,









share



























    0















    I used PBM to manage my policy against my user DBs.
    The Condition is:



    Declare @condition_id int
    EXEC msdb.dbo.sp_syspolicy_add_condition @name=N'SP_Naming_convention', @description=N'', @facet=N'StoredProcedure', @expression=N'<Operator>
    <TypeClass>Bool</TypeClass>
    <OpType>LIKE</OpType>
    <Count>2</Count>
    <Attribute>
    <TypeClass>String</TypeClass>
    <Name>Name</Name>
    </Attribute>
    <Constant>
    <TypeClass>String</TypeClass>
    <ObjType>System.String</ObjType>
    <Value>usp_%</Value>
    </Constant>
    </Operator>', @is_name_condition=2, @obj_name=N'usp_%', @condition_id=@condition_id OUTPUT
    Select @condition_id

    GO


    The policy is:



    Declare @object_set_id int
    EXEC msdb.dbo.sp_syspolicy_add_object_set @object_set_name=N'SP_Naming_ObjectSet', @facet=N'StoredProcedure', @object_set_id=@object_set_id OUTPUT
    Select @object_set_id

    Declare @target_set_id int
    EXEC msdb.dbo.sp_syspolicy_add_target_set @object_set_name=N'SP_Naming_ObjectSet', @type_skeleton=N'Server/Database/StoredProcedure', @type=N'PROCEDURE', @enabled=True, @target_set_id=@target_set_id OUTPUT
    Select @target_set_id

    EXEC msdb.dbo.sp_syspolicy_add_target_set_level @target_set_id=@target_set_id, @type_skeleton=N'Server/Database/StoredProcedure', @level_name=N'StoredProcedure', @condition_name=N'', @target_set_level_id=0
    EXEC msdb.dbo.sp_syspolicy_add_target_set_level @target_set_id=@target_set_id, @type_skeleton=N'Server/Database', @level_name=N'Database', @condition_name=N'', @target_set_level_id=0


    GO

    Declare @policy_id int
    EXEC msdb.dbo.sp_syspolicy_add_policy @name=N'SP_Naming', @condition_name=N'SP_Naming_convention', @policy_category=N'', @description=N'Get out of my box you DEV!', @help_text=N'Stop doing this!', @help_link=N'', @schedule_uid=N'00000000-0000-0000-0000-000000000000', @execution_mode=1, @is_enabled=True, @policy_id=@policy_id OUTPUT, @root_condition_name=N'', @object_set=N'SP_Naming_ObjectSet'
    Select @policy_id


    GO


    I tried to create an SP named usp_whatever:



    create proc usp_whatever
    as
    begin
    select @@VERSION
    end


    But the policy still blocked mine...
    Any thought? Thanks,









    share

























      0












      0








      0








      I used PBM to manage my policy against my user DBs.
      The Condition is:



      Declare @condition_id int
      EXEC msdb.dbo.sp_syspolicy_add_condition @name=N'SP_Naming_convention', @description=N'', @facet=N'StoredProcedure', @expression=N'<Operator>
      <TypeClass>Bool</TypeClass>
      <OpType>LIKE</OpType>
      <Count>2</Count>
      <Attribute>
      <TypeClass>String</TypeClass>
      <Name>Name</Name>
      </Attribute>
      <Constant>
      <TypeClass>String</TypeClass>
      <ObjType>System.String</ObjType>
      <Value>usp_%</Value>
      </Constant>
      </Operator>', @is_name_condition=2, @obj_name=N'usp_%', @condition_id=@condition_id OUTPUT
      Select @condition_id

      GO


      The policy is:



      Declare @object_set_id int
      EXEC msdb.dbo.sp_syspolicy_add_object_set @object_set_name=N'SP_Naming_ObjectSet', @facet=N'StoredProcedure', @object_set_id=@object_set_id OUTPUT
      Select @object_set_id

      Declare @target_set_id int
      EXEC msdb.dbo.sp_syspolicy_add_target_set @object_set_name=N'SP_Naming_ObjectSet', @type_skeleton=N'Server/Database/StoredProcedure', @type=N'PROCEDURE', @enabled=True, @target_set_id=@target_set_id OUTPUT
      Select @target_set_id

      EXEC msdb.dbo.sp_syspolicy_add_target_set_level @target_set_id=@target_set_id, @type_skeleton=N'Server/Database/StoredProcedure', @level_name=N'StoredProcedure', @condition_name=N'', @target_set_level_id=0
      EXEC msdb.dbo.sp_syspolicy_add_target_set_level @target_set_id=@target_set_id, @type_skeleton=N'Server/Database', @level_name=N'Database', @condition_name=N'', @target_set_level_id=0


      GO

      Declare @policy_id int
      EXEC msdb.dbo.sp_syspolicy_add_policy @name=N'SP_Naming', @condition_name=N'SP_Naming_convention', @policy_category=N'', @description=N'Get out of my box you DEV!', @help_text=N'Stop doing this!', @help_link=N'', @schedule_uid=N'00000000-0000-0000-0000-000000000000', @execution_mode=1, @is_enabled=True, @policy_id=@policy_id OUTPUT, @root_condition_name=N'', @object_set=N'SP_Naming_ObjectSet'
      Select @policy_id


      GO


      I tried to create an SP named usp_whatever:



      create proc usp_whatever
      as
      begin
      select @@VERSION
      end


      But the policy still blocked mine...
      Any thought? Thanks,









      share














      I used PBM to manage my policy against my user DBs.
      The Condition is:



      Declare @condition_id int
      EXEC msdb.dbo.sp_syspolicy_add_condition @name=N'SP_Naming_convention', @description=N'', @facet=N'StoredProcedure', @expression=N'<Operator>
      <TypeClass>Bool</TypeClass>
      <OpType>LIKE</OpType>
      <Count>2</Count>
      <Attribute>
      <TypeClass>String</TypeClass>
      <Name>Name</Name>
      </Attribute>
      <Constant>
      <TypeClass>String</TypeClass>
      <ObjType>System.String</ObjType>
      <Value>usp_%</Value>
      </Constant>
      </Operator>', @is_name_condition=2, @obj_name=N'usp_%', @condition_id=@condition_id OUTPUT
      Select @condition_id

      GO


      The policy is:



      Declare @object_set_id int
      EXEC msdb.dbo.sp_syspolicy_add_object_set @object_set_name=N'SP_Naming_ObjectSet', @facet=N'StoredProcedure', @object_set_id=@object_set_id OUTPUT
      Select @object_set_id

      Declare @target_set_id int
      EXEC msdb.dbo.sp_syspolicy_add_target_set @object_set_name=N'SP_Naming_ObjectSet', @type_skeleton=N'Server/Database/StoredProcedure', @type=N'PROCEDURE', @enabled=True, @target_set_id=@target_set_id OUTPUT
      Select @target_set_id

      EXEC msdb.dbo.sp_syspolicy_add_target_set_level @target_set_id=@target_set_id, @type_skeleton=N'Server/Database/StoredProcedure', @level_name=N'StoredProcedure', @condition_name=N'', @target_set_level_id=0
      EXEC msdb.dbo.sp_syspolicy_add_target_set_level @target_set_id=@target_set_id, @type_skeleton=N'Server/Database', @level_name=N'Database', @condition_name=N'', @target_set_level_id=0


      GO

      Declare @policy_id int
      EXEC msdb.dbo.sp_syspolicy_add_policy @name=N'SP_Naming', @condition_name=N'SP_Naming_convention', @policy_category=N'', @description=N'Get out of my box you DEV!', @help_text=N'Stop doing this!', @help_link=N'', @schedule_uid=N'00000000-0000-0000-0000-000000000000', @execution_mode=1, @is_enabled=True, @policy_id=@policy_id OUTPUT, @root_condition_name=N'', @object_set=N'SP_Naming_ObjectSet'
      Select @policy_id


      GO


      I tried to create an SP named usp_whatever:



      create proc usp_whatever
      as
      begin
      select @@VERSION
      end


      But the policy still blocked mine...
      Any thought? Thanks,







      sql-server policy-based-management





      share












      share










      share



      share










      asked 3 mins ago









      DBALUKE HUANGDBALUKE HUANG

      496




      496






















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "182"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f232937%2fwhy-sp-naming-policy-still-blocked-my-correct-creating%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Database Administrators Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f232937%2fwhy-sp-naming-policy-still-blocked-my-correct-creating%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          ORA-01691 (unable to extend lob segment) even though my tablespace has AUTOEXTEND onORA-01692: unable to...

          Always On Availability groups resolving state after failover - Remote harden of transaction...

          Circunscripción electoral de Guipúzcoa Referencias Menú de navegaciónLas claves del sistema electoral en...