Reputation: 2861
I'm working with SQL Server on a database which has tables, views and stored procedures. This database will surely be used by some other persons and I want to block the access to my stored procedures code. Is it possible to do that?
Upvotes: 0
Views: 425
Reputation: 2266
You can encrypt procedure code (if that is what you want to hide) by adding "With Encryption":
Create Procedure MyProc
With Encryption
As
Select 1;
But for sysadmins its still will be possible to get to procedure code (with a bit of effort).
Upvotes: 2
Reputation: 69574
You can revoke their EXECUTE permission on your stored procedure something like this..
REVOKE EXECUTE ON OBJECT::dbo.Proc_Name
FROM NaughtyPerson;
GO
Upvotes: 1