Home Forums SQL Server 2008 SQL Server 2008 - General Data in certain fields in a table needs to be encrypted and later on decrypted to be used in sp. What should be the appropriate data type that can be used so that the same column can hold both the encrypted form and decrypted form of data? RE: Data in certain fields in a table needs to be encrypted and later on decrypted to be used in sp. What should be the appropriate data type that can be used so that the same column can hold both the encrypted form and decrypted form of data?

  • The insert query needs to call the encryptbykey function with the appropriate parameters.

    Depending on how you do this with SSIS, there are different ways, but essentially you need to open the key (probably a t-sql or script task), and keep it open, so the same connection needs to be used for multiple tasks.

    In a data transform, not sure you can call a function there, but you could either insert and then encrypt, or use a different task for the encryption.