Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Send email and attach different files
Message
From
12/10/2004 15:00:44
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Send email and attach different files
Miscellaneous
Thread ID:
00950802
Message ID:
00950802
Views:
58
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
Next
Reply
Map
View

Click here to load this message in the networking platform