--建表(加密字段要为二进制数据类型)
create table ls(
mw varbinary(500))
--存入加密字段
insert into ls
select EncryptByPassPhrase('bngyuw', 'abc')
--查看加密字段
select convert(varchar,DecryptByPassPhrase('bngyuw', mw)) from ls
--建表(加密字段要为二进制数据类型)
create table ls(
mw varbinary(500))
--存入加密字段
insert into ls
select EncryptByPassPhrase('bngyuw', 'abc')
--查看加密字段
select convert(varchar,DecryptByPassPhrase('bngyuw', mw)) from ls
转载于:https://www.cnblogs.com/bingyuw/archive/2011/05/11/2042756.html