Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
sanlen
Starting Member
29 Posts |
Posted - 2008-12-04 : 23:45:55
|
| Hi All,I have the table as belowcreate table tbl_test(id int, user_name varchar(20), acc_name varbinary(50))And with data inserted as belowinsert into tbl_test (id, user_name, acc_name) values (1, 'Name1', EncryptByPassPhrase('abc','002Name1'))insert into tbl_test (id, user_name, acc_name) values (2, 'Name2', EncryptByPassPhrase('xyz','002Name2'))I try to show data from that table as below:select id, user_name, convert (varchar(50),DecryptByPassPhrase('abc', acc_name)) as Account_Name from tbl_test where id=1I can get the result as i want base on id. However, i want to get the list of all data from the table. Could you please advise how can i show all data? Thanks you very much for your time and any advise you may give me.Best Regard,SANLEN |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
karthickbabu
Posting Yak Master
151 Posts |
Posted - 2008-12-05 : 00:18:38
|
| You need to check that Encrypt and Decrypt funciton.==================================================== you realize you've made a mistake, take immediate steps to correct it. |
 |
|
|
cvraghu
Posting Yak Master
187 Posts |
Posted - 2008-12-05 : 02:19:21
|
| Then you should encrypt using same keys for all rows - 'abc'. You shd not use 'xyz' for next row. Right? |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-12-05 : 02:31:23
|
| or store that passphrase along with this tables pk into another table and join onto that while decrypting. |
 |
|
|
sanlen
Starting Member
29 Posts |
Posted - 2008-12-05 : 02:32:33
|
quote: Originally posted by cvraghu Then you should encrypt using same keys for all rows - 'abc'. You shd not use 'xyz' for next row. Right?
Yes, it works fine if i use the same key, but i want to try it with different keys. Could you please advise??Best Regard,SANLEN |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|
|
|
|