I have used SQL Server database with data to be encrypted and I will use symmetric key for encryption and will encrypt it by asymmetric key now comes the question how to give user permission to encrypt and not to decrypt

I have found this article that propose creating two procedures and use them as security mechanism however my question here where is the public/private key thing of asymmetric encryption.

Are there any other solutions?

  • What version of SQL are you running? Jun 15, 2015 at 3:08
  • I am using Sql Server 2012 Jun 19, 2015 at 11:13

1 Answer 1


I wrote a series of stored procedures (specifically for MySQL vs. MSSQL) that might be of interest. You can view it at sqlSec.

Keep in mind that it is more a proof of concept using stored procedures to rotate symmetric encryption keys but does provide a transparent encryption/decryption procedure examples in the readme.

  • Thanks for the references however I still didn't understand how that is really handled inside SQL Server May 16, 2015 at 0:47
  • 1
    Why are you trying to do encryption in the database? It's going to be 10 times easier to do your encryption in some language other than t-sql that interacts as a client rather than on the sql server directly. Feb 10, 2016 at 15:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .