How to send password protected attachement file throgh SQL 2005

  • I want to send password protected attachement through sp_send_dbmail or any other way in SQL 2005.

    If anyone know pls help me.

  • sp_send_dbmail [ [ @profile_name = ] 'profile_name' ]

    [ , [ @recipients = ] 'recipients [ ; ...n ]' ]

    [ , [ @copy_recipients = ] 'copy_recipient [ ; ...n ]' ]

    [ , [ @blind_copy_recipients = ] 'blind_copy_recipient [ ; ...n ]' ]

    [ , [ @subject = ] 'subject' ]

    [ , [ @body = ] 'body' ]

    [ , [ @body_format = ] 'body_format' ]

    [ , [ @importance = ] 'importance' ]

    [ , [ @sensitivity = ] 'sensitivity' ]

    [ , [ @file_attachments = ] 'attachment [ ; ...n ]' ]

    [ , [ @query = ] 'query' ]

    [ , [ @execute_query_database = ] 'execute_query_database' ]

    [ , [ @attach_query_result_as_file = ] attach_query_result_as_file ]

    [ , [ @query_attachment_filename = ] query_attachment_filename ]

    [ , [ @query_result_header = ] query_result_header ]

    [ , [ @query_result_width = ] query_result_width ]

    [ , [ @query_result_separator = ] 'query_result_separator' ]

    [ , [ @exclude_query_output = ] exclude_query_output ]

    [ , [ @append_query_error = ] append_query_error ]

    [ , [ @query_no_truncate = ] query_no_truncate ]

    [ , [ @query_result_no_padding = ] query_result_no_padding ]

    [ , [ @mailitem_id = ] mailitem_id ] [ OUTPUT ]

    @file_attachmentsSemicolon-separated list of file names for attachments as absolute file paths

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • Use some app outside of SQL to password protect the file.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • Thanks for reply.

    I want to use some inbuilt SQL features.

  • As a separate step you could execute xp_cmdshell if this must be done via SQL Server. However, you could do this using an OO language rather than TSQL.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • If you have any script related to this please give me.I have urgent requirement.

  • declare @cmd varchar(255)

    set @cmd = 'C:WinZip\WINZIP32.exe d:\testzip.zip'

    exec master..xp_cmdshell @cmd

    This is an example. I'm guessing this example actually unzips a file.

    You will need to first use WINZIP32.exe to add password protection. So research winzips command line switches so you can write a command that will password protect your file. Do this all outside of SQL server. When you have the proper command line syntax call it with xp_cmdshell.

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply