In this article I am going to explain how to Encrypt store procedure, view and function in sql server.
In previous article I have explained how to take database Backup and restore usingcommand T-Sql, Sql server REPLACE function and Sql server TRIM function.
We write most of logic in Store procedures. Sometime due to security reason we have to hide the logic from end users. Keyword With encryption is used to encrypt the text/logic of store procedure, view and function.
Encrypt store procedure
create proc sp with encryption
Select * from tablename
create proc Spuser with encryption
Select * from dbo.tbuser
create view fnuser with encryption
Select * from tbuser
CREATE FUNCTION udfnuse (@userID int)
RETURNS int with encryption
Note: if store procedure, view and function are encrypted it is not possible to get definition. We can get the definition of encrypted store procedures, view and function using the third party tools (Optillect SQL Decryptor).
What do you think about this article?
If you found this article useful, please share and follow on Facebook, Twitter, Google Plus and other social media websites. To get free updates subscribe to newsletter. Please put your thoughts and feedback in comments section.