none
SSIS: CSV Source File - Password Protected

    Dotaz

  • Hi Experts , 

    I have CSV file as Source to load data into SQL Table.

    I can either use SSIS(version 2016)- Flat File Source or BCP IN approach to Load data into SQL Table Destination.

    My Concern: My CSV files are password Protected example ,Passowrd is XY@123.
    How can I decrypt the File by Using above password Before READING IT via BCP 

    Do we have an approach Without using C# Code USING Either T-SQL or SSIS 

    I am using SQL SERVER 2016

    pondělí 14. května 2018 12:11

Všechny reakce

  • There is no way to password protect a CSV file.

    Are you referring to a ZIP file or something which has a password, and a single file in the package?

    pondělí 14. května 2018 12:59
  • Nope

    As far as I know you cant decrypt password protected files using any straightforward ways in T-SQL


    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    ----------------------------
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

    pondělí 14. května 2018 13:00
  • Hi Visakh,
    Thanks for the Reply but this seems to be disappointing and I do not have any direct Option to remove Password/Decrypt password from File using T-sql and we only have to go/Use  C#

    I tried Looking into Below Code/URL 

    https://www.codeproject.com/Articles/26085/File-Encryption-and-Decryption-in-C

    Can you suggest if this would be the best option to Decrypt File before using it as source in SSIS

    Decrypt File
    • Upravený MS308 úterý 15. května 2018 4:50 edit
    úterý 15. května 2018 4:49
  • Hi Visakh,
    Thanks for the Reply but this seems to be disappointing and I do not have any direct Option to remove Password/Decrypt password from File using T-sql and we only have to go/Use  C#

    I tried Looking into Below Code/URL 

    https://www.codeproject.com/Articles/26085/File-Encryption-and-Decryption-in-C

    Can you suggest if this would be the best option to Decrypt File before using it as source in SSIS

    Decrypt File

    Let me understand your scenario

    Are you asking a way to encrypt your file?

    The idea I got from your first post was you are trying to access data within a CSV file which is password protected by someone else

    The above article is using an instance of RijndaelManaged class to encrypt a file and then decrypt it back



    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    ----------------------------
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

    úterý 15. května 2018 5:48
  • Hi Visakh, 

    I only want to Decrypt Password Protected File(Encrypted by someone else, Client only have shared password to Decrypt) file before consuming it in SSIS as Flat File Source.

    Link Share above have both Encrypt and Decrypt option ,

    I planned of Using only DECRYPT Code from that article (and Ignore Encrypt code)

    Please suggest !


    Note: I do not have good understanding/working knowledge on C# 
    • Upravený MS308 středa 16. května 2018 5:35 edit
    středa 16. května 2018 5:32