Security : Encryption and Decryption function in SQL Server
Hi Folks, This is a continuation of my last Blog post. Enjoy.
Before You Start you must have,
- Visual Studio 2005/2008/2010 installed
- MS SQL Server 2005/2008 installed
Step 1: Create an SQL Server Project in Visual Studio
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9l1oyfg8r49ow4kikpCwTFCBlcaP6BuuvXte-qayvXQoDgULVhhPebBaM0yz46DWVGbosShoWjOOwF703f1U0DTqn_VbifX14Jn3Qq0eBZ5Vv9kXbnRWhTvTx_40wSKm86-8s_QbHmTY/s320/first.jpg)
Step 2 : Add a user defined Function
Step 3 : Add the code in my previous blog which Encrypts a string to the user defined function
Step 4 : Add Database reference to the Database which you want to deploy the function
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9nhYHdKtSZexR8L-2fOG2K3eyjxG3Y7dXhgXr9kX0j-uR3pTvaDGCexeKH77XKThyphenhyphenTtofnMjaSQCfiuegWJ45qW48H3IpUac5J8JH4S0dVfiZ3sTGaSFexUr2Cpgtn6L_gibxYGaT96g/s320/1st.jpg)
Step 5 : Right Click on the Project and Click Deploy
once deployed you can see the Project has been deployed on your database under.
[Database Name]->Programmability->Assemblies
Before You Start you must have,
- Visual Studio 2005/2008/2010 installed
- MS SQL Server 2005/2008 installed
Step 1: Create an SQL Server Project in Visual Studio
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9l1oyfg8r49ow4kikpCwTFCBlcaP6BuuvXte-qayvXQoDgULVhhPebBaM0yz46DWVGbosShoWjOOwF703f1U0DTqn_VbifX14Jn3Qq0eBZ5Vv9kXbnRWhTvTx_40wSKm86-8s_QbHmTY/s320/first.jpg)
Step 2 : Add a user defined Function
Step 3 : Add the code in my previous blog which Encrypts a string to the user defined function
Step 4 : Add Database reference to the Database which you want to deploy the function
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9nhYHdKtSZexR8L-2fOG2K3eyjxG3Y7dXhgXr9kX0j-uR3pTvaDGCexeKH77XKThyphenhyphenTtofnMjaSQCfiuegWJ45qW48H3IpUac5J8JH4S0dVfiZ3sTGaSFexUr2Cpgtn6L_gibxYGaT96g/s320/1st.jpg)
Step 5 : Right Click on the Project and Click Deploy
once deployed you can see the Project has been deployed on your database under.
[Database Name]->Programmability->Assemblies
Step 6 : Use the Functions in SQL Server
Once the Project is deployed you can see the two functions in
[Database Name]->Programmability->Functions->Scalar-valued Functions
Then they can be used in SQL Server as regular functions.
Comments
Post a Comment