How to encrypt your script on sql server

4,903 views
4,619 views

Published on

Published in: Technology, Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
4,903
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
25
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

How to encrypt your script on sql server

  1. 1. How to encrypt your function or stored procedure on Microsoft SQL Server 2008 R2<br />By: <br />IkhwanKrisnadi<br />Software Engineer<br />Y!: ikhwankrisnadi<br />Gtalk: krisnadiikhwan<br />
  2. 2. Introduction<br />SQL Server 2008 R2 gives facility to encrypt your script of function or stored procedure<br />If you encrypt it, your function or stored procedure can not be viewed its source code<br />Also, you can not generate script of your function or stored procedure that you encrypted<br />
  3. 3. How to encrypt?<br />Add option WITH ENCRYPTION on your script of function or stored procedure<br />Encryption on function<br />
  4. 4. How to encrypt? (continued)<br />Encryption on stored procedure<br />
  5. 5. Example: Encrypt on Function<br />Create function with named fnAdd2Numbers . This function to calculate sum of 2 numbers<br />
  6. 6. Example: Encrypt on Function (Continued)<br />Right click on your function at Microsoft SQL Server Management Studio 2008 R2 . Then click “Modify” or “Script Function as”<br />
  7. 7. Example: Encrypt on Function (Continued)<br />It will displayed below message to indicate that you can not modify or view its script<br />
  8. 8. Example: Encrypt on Stored Procedure<br />Create function with named spAdd2Numbers . This stored procedure to calculate sum of 2 numbers then output the result<br />
  9. 9. Example: Encrypt on Stored Procedure (Continued)<br />Right click on your stored procedure at Microsoft SQL Server Management Studio 2008 R2 . Then click “Modify” or “Script Function as”. You can not click “Modify” because it is disabled. Click “Script Function as”<br />
  10. 10. Example: Encrypt on Stored Procedure (Continued)<br />It will displayed below message to indicate that you can not modify or view its script<br />

×