PrepAway - Latest Free Exam Questions & Answers

Which three actions should you perform in sequence?

You administer a Microsoft SQL Server 2012 server that has multiple databases.
You need to ensure that users are unable to create stored procedures that begin with sp_.
Which three actions should you perform in sequence?(To answer, move the appropriate actions from the list of
actions to the answer area and arrange them in the correct order.)
Select and Place:

PrepAway - Latest Free Exam Questions & Answers

Answer:

Explanation:

19 Comments on “Which three actions should you perform in sequence?

  1. MSFT says:

    It would be LIKE because we have to prevent user from creating those procedures. As soon as someone creates proc would name sp_ the policy should fire and “prevent” this action.




    0



    0
  2. deni says:

    http://stackoverflow.com/questions/7581811/how-to-avoid-users-adding-a-user-stored-procedure-name-like-sp

    Open SQL Management Studio
    Go to “management” -> Conditions -> Create new condition
    Enter a name for the condition.
    Select Facet “Stored Procedure”
    Enter in the column “Field” @name
    Enter in the column “Operator” NOT LIKE
    Enter in the column “Value” ‘sp[_]%’
    Click on OK to save

    Create a policy. Go to “management” -> Policy -> Create new Policy

    Enter a name for the Policy
    Select the name of the condition in the dropdown menu “check condition”
    Set “Evaluation Mode” to ‘On change:Prevent’
    Enable the policy
    Click on OK to save and enable the policy

    Test the policy by entering a new query




    0



    0
  3. Jack says:

    Mustafa and deni are correct. You must use the NOT LIKE option to get this to work.

    Be aware that the question states that users must be *unable* to create stored porcedures that start with ‘sp_’. That’s a NOT LIKE ‘sp[_]’ condition that needs to be implemented.

    The condition is a boolean expression that is tested by the policy. If the condition evaluates to TRUE, then all is well, as wanted. If it evaluates to FALSE, then the policy will handle it according to the Evaluation Mode you’ve chosen.

    So, if the condition is:

    @Name NOT LIKE ‘sp[_]’

    and I try to run this code:

    create procedure dbo.sp_test
    @test int
    AS
    (whatever)
    GO

    then the condition evaluates to FALSE. This means the “On Change: prevent” evaluation mode in the policy kicks in and prevents sp_test from being created.




    0



    0
  4. DRIVING SCHOOLS says:

    Next time I review a blog site, I hope me as much as this one that it doesnt disappoint. After all, i understand they is my solution to read, but I really planning youd have actually some thing interesting to say. All I discover is actually a number of whining about some thing if you werent too busy looking for attention that you could fix.

    https://www.evernote.com/shard/s684/sh/e951de52-0519-4ac3-8793-96fe248286ff/6d4e7595e224258d852ae9ec906740e2




    0



    0
  5. jzed_dont_give_up says:

    Sorry, but the common sense logic is to prevent something LIKE ‘sp[_]%’. No matter what everybody states here, I’ll go for common sense…




    0



    0
  6. Adrian says:

    I agree that common sense would say that you try and identify a specific criteria (with LIKE) in the condition , then prevent it using a policy.

    I have just tried it and you need to use NOT LIKE in order to prevent any stored procedure to be created with a sp_ name.

    If you use LIKE , you can just carry on creating stored procedures named sp_.

    Those who disagree need to try it. I did to start with and I’ve proven myself wrong.




    0



    0

Leave a Reply