SQL Server Performance Forum – Threads Archive
scripts to send email, the content of text fileI have the text file updated from the out put of some job scripts every hour and i need to write the scripts that will send the email to my designation and the contents should be of the text file. I need to add 2 step of the job where it wil send the email when the first job is done. if any one can send the script to send the text file content as email i should be fine.
I want to thank your anticipation
create table ##textfile (details Varchar(max))
insert into ##textfile
exec master..xp-cmdshell ‘type c:inioInstall.txt’ — you can xp-readerrorlog also can be used to read the txt file… EXEC msdb.dbo.sp_send_dbmail
@profile_name = ‘AdventureWorks Administrator’,
@recipients = ‘[email protected]‘,
@query = ‘select * from ##textfile’ ,
@subject = ‘Work Order Count’ Mohammed U.