Encryption for SQL Server 2008 stored Procedures

Source: Internet
Author: User

Stored Procedure Encryption

The reasons for use are as follows:

1, the use of stored procedures, at least in the prevention of illegal injection (inject) to provide better protection . At the very least, pre-compilation is performed first before the stored procedure executes, (if the cause of an illegal argument) is not executed, which in some way provides a layer of natural barrier.

2. Using stored procedures instead of direct access to the base table provides better security . You can control how data is modified at the row or column level. With respect to table access, you can confirm that a user with permission to execute the appropriate stored procedure. This is also the only way to access the data server. Therefore, any peeping person will not be able to see your SELECT statement. In other words, each app can only have the corresponding stored procedure to access the base table instead of "Sleect *".

The encryption of stored procedures is very simple, let's look at an example:

/********* using the database *****************/use migo/*************** to create an unencrypted stored procedure *******************/create Procedure CPP_test_ Originalasselect * from userinfogo/*************** Creating an encrypted stored procedure *******************/create Procedure cpp_test_encryption With Encryptionas----can be replaced with any logical execute CPP_TEST_ORIGINALGO

  

After successful creation:

And this stored procedure is not open, this is the encryption

Unencrypted stored procedure:

Encrypted stored procedures:

Encryption for SQL Server 2008 stored Procedures

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.