Thursday, 7 March 2013

How to Encrypt and Decrypt a fild in Sql Server 2008

How to Encrypt and Decrypt a fild in Sql Server 2008



Step:1- Create a table

create table student(id int identity(1,1) not null primary key,name varbinary(50))

Insert Encrypted Data in Sql :-

 insert into student(name) values(encryptbypassphrase('rahul','Ramu Gupta'))

Show data with Decryption:-

 select id,convert(varchar(max),Decryptbypassphrase('rahul',name))as Name from student


0 comments: