3 March 2014

How to Encrypt and Decrypt a fild in Sql Server 2008

Create a table :-

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

Insert Encrypted Data in Sql :-

 insert into tbl_employee(name) values(encryptbypassphrase('abc','jc.adi'))

Show data with Decryption:-

 select id,convert(varchar(max),Decryptbypassphrase('abc',name))as name from tbl_employee

No comments:

Post a Comment