Praveen Kumar
How can you encrypt the Stored procedure?

We can encrypt the stored procedures using “WITH ENCRYPTION”.
After stored procedure name we have to write the “WITH ENCRYPTION”.

EXAMPLE:
CREATE PROCEDURE spViewEmployees WITH ENCRYPTION
AS
BEGIN
SELECT * FROM Employee
END

Then when you try to find the stored procedure text using the SysComments table text column is coming null.

SELECT * FROM SYSCOMMENTS WHERE ID = OBJECT_ID(‘spViewEmployees’)

By Praveen Kumar in SQL on Jun 12 2020
  • Jay Krishnareddy
    Jul, 2020 20

    In SQL Server, you can encrypt a stored procedure at the time you create it, or you can alter it later to include encryption. To create a stored procedure with T-SQL, you use the CREATE PROCEDURE syntax. To encrypt it, you add the WITH ENCRYPTION argument.

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS