Articles → SQL SERVER → Stored Procedure Encryption In SQL Server
Stored Procedure Encryption In SQL Server
Software Requirement
Prerequisite Knowledge
What Does Encryption Mean?
Syntax
CREATE PROC [PROC_NAME]
[LIST OF INPUT VARIABLES]
WITH ENCRYPTION
AS
[PROC_BODY]
Example
CREATE PROC sp_GetDBName @db_name varchar(100) WITH ENCRYPTION AS
SELECT
*
FROM
SYS.databases
Where
name = @db_name
Disadvantage Of Encrypting A Stored Procedure
- Stored procedure definitions should be stored in a separate file, as encrypted procedures cannot be retrieved from SQL Server Management Studio. If this file is lost, the definition is irrecoverable.
- Encryption requires an extended handshake and lots of CPU cycles. For high-volume sites, you need a high-performance CPU