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:

It should be
Create Condition (Not Like)
Create Policy (prevent)
Enable policy
2
0
nope… you prevent a LIKE SP%
0
0
Hi friends the real answer of this is
7
5
1
vimal lohani
mcp
0
0
The correct answer should be:
6,5,1
create a condition (Not like)
create a policy ( prevent on change)
enable
0
0
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
I agree with om kumar’s aswer.
The condition must be like to prevent creating stored. I tested it so i’m pretty sure!
0
0
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
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
Deni, mustafa, jack are right:
http://www.mssqltips.com/sqlservertip/2298/enforce-sql-server-database-naming-conventions-using-policy-based-management/
it’s the “not like”
0
0
6 5 1
0
0
Just tried it, the anwser is ‘NOT LIKE’. 100% verified !
0
0
please email the pdf to sgkg5973@gmail.com
0
0
gskg5973@gmail.com
0
0
this question is very wierd.. donno if to choose LIKE or NOT LIKE..
NOT LIKE is verified answer though…
0
0
6,5,1
0
0
Hi, the answer:
Box 6
Box 5
Box 1
https://social.msdn.microsoft.com/Forums/en-US/6222b41a-fd51-47bf-ad4c-ccf06aa39b8e/070462-enable-condition?forum=sqldocumentation
0
0
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
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
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