Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Send email and attach different files
Message
De
12/10/2004 15:00:44
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Send email and attach different files
Divers
Thread ID:
00950802
Message ID:
00950802
Vues:
59
I want to send a email and attach different files each day.
For example, today will attach file named Reponse20041012.txt. Tomorrow will another file Reponse20041013.txt.

I have following code. It didn't work. I feel some confused where to use ' and ".



DECLARE @cmd varchar(200)
Declare @Response varchar(50)
set @Response= 'Response'+CONVERT(char(8), getdate(), 112)+'.txt'

set @cmd = 'master..xp_sendmail @recipients = "JimHou",'
+'@subject = "Response Report",'
+'@attachments = "N:\DATA\"'+@Response
EXEC @cmd


Thanks


Jim
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform