SQL Server Performance

attachments in xp_readmail sql 2008 .

Discussion in 'SQL Server 2008 T-SQL Performance Tuning' started by Damo, Jan 20, 2010.

  1. Damo New Member

    Good Morning I am working with sql Xp_readmail in 2008, and have the following problem, some form of him to set the parameter @ attachments by default save the attachment in a temporary folder within the profile and i need to save to a selected folder and rename it.

    thank you very much and hugs to all
  2. MohammedU New Member

    Try populating the @AttachedFiles parameter from @attachments parameter of xp_readmail and then use copy commad with xp_cmdshell to move/copy to different location....I don't think there is an option to change the location...
    declare @AttachedFiles varchar(1000)
    set @AttachedFiles = 'copy /Y ' + @AttachedFiles + ' C:AttachedFolder'
    print @AttachedFiles
    exec master..xp_cmdshell @AttachedFiles
  3. preethi Member

    Microsoft says that this feature (xp_ReadMail) will be removed in the future. It is always better to avoid using SQL Server for features like this. SQL Server is best useful to read data from database and not from mail servers.

Share This Page