gtjr921
Programmer
- Aug 30, 2006
- 115
I have a Sql 2005 Table that has an encrypted field by Asymmetric encryption.
Data is imported to this table via an Access DB.
That data has sensitive data that is not encrypted.
in order to properly import the data the Stored Procedure in Sql checks for Sensitive (unencrypted) data in the access db and trys to match it with the encrypted data.
For some reason I just get null data, if i query the sql db and the access db separately i get the proper data.
I need it to Join so that data from access can be imported
Here are my queries
Data is imported to this table via an Access DB.
That data has sensitive data that is not encrypted.
in order to properly import the data the Stored Procedure in Sql checks for Sensitive (unencrypted) data in the access db and trys to match it with the encrypted data.
For some reason I just get null data, if i query the sql db and the access db separately i get the proper data.
I need it to Join so that data from access can be imported
Here are my queries
Code:
--working select query
select convert (Nvarchar(50),
DecryptByasymKey(Asymkey_ID('MYAsymmetricKey'),
MYEncryptedfield,N'MyASMPword')) As MYENCField
from MySqlTable
--Broken Join to Access just gives null data
SELECT Access.MyUnEncryptedField,getdate()
FROM
OPENROWSET('Microsoft.Jet.OLEDB.4.0','c:\accessfield.mdb';
'admin';'',AccessTbl)
as Access Inner Join SQLDB.dbo.MyInfo as MySQLDB On convert (Nvarchar(50), DecryptByasymKey(Asymkey_ID('MYAsymmetricKey'), mySQLDB.MyEncryptedField,N'ASMPword')) = Access.MyUnEncryptedField