question

Susja avatar image
0 Votes"
Susja asked OlafHelper-2800 answered

Encrypt Result Set from SQL Statement

I have a task to run an SQL Statement, generate Result Set, encrypt it using GPG and send to user. I am using GPG4Win-3.1.15 which contains GPG 2.2.x It works fine for me BUT my goal is to get encrypted file directly from SQL query. I don't want first generate Result Set, convert it to .csv and then encrypt.
I know that using Toad one could use Toad's Automation Engine to create a work flow. It will have 2 steps
Key here is to use the Run Program task so that you can call gpg utility.
In my case I don't have Toad hence I have to use MS Studio.
Could someone advice how to do it using MS Studio?
Thanks

sql-server-general
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

OlafHelper-2800 avatar image
0 Votes"
OlafHelper-2800 answered

In SQL Server / Transact-SQL we have several encryption function, but I don't one which equals GPG; see Cryptographic functions (Transact-SQL)
So you have to find a different way to create the encrypted file.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.