dbmail

Send db mail task fails in SSIS Package with errors related to the parameter

杀马特。学长 韩版系。学妹 提交于 2019-12-13 03:58:34
问题 I am trying to execute this sql task in SSIS package which send an email when the file name is not found. I have declared this user-defined variable "@PackageStartTime" in my ssis package. But when my SSIS package hit this task it fails with following error. "Executing query DECLARE @PackageStartTime Varchar(250) SET @Packag...." failed with the error.: "Parameter name is unrecognized." Possible failure reasons: Problem with the query, "ResultSet" Property not set correctly, parameters not

Sql server Db Mail which can send mail for two or more queries

自作多情 提交于 2019-12-12 17:06:25
问题 I want to send db mail , which contains the result of two queries, how do I make it happen? USE msdb EXEC sp_send_dbmail @profile_name = 'try01', @recipients = 'yyyyy@yyy.com', @subject = 'Table Values', @body = 'xxxxxxxxxxxxxx.', @execute_query_database = 'Reports', @query = 'SELECT * from Table' 回答1: OK, This was easy as if you put a semicolon the result of both the queries are sent. Here it is: USE msdb EXEC sp_send_dbmail @profile_name = 'try01', @recipients = 'yyyyy@yyy.com', @subject =

Send dbMail from SQL Server 2000 with Tabular structured data?

房东的猫 提交于 2019-12-11 11:29:22
问题 I am trying to achieve this kind of formatted data from my select statement and have it send via database mail in SQL SERVER 2000. I know how to do this in SQL 2008. Column1 | Column 2 ------------------ Value 1 | Value 2 Value 1 | Value 2 Value 1 | Value 2 回答1: I have realized that this can not be done. To achieve this I created .bat file and stored procedures and sendmail utility. First call this in your .bat file osql -S %ServerName% -d %dbname% -U %username% -P %password% -Q "EXEC " -o

Send email from SQL server for each row of a dataset

让人想犯罪 __ 提交于 2019-12-11 08:22:15
问题 I have built a stored procedure for sending an email reminder to a set of employees each week. The SQL server agent runs a scheduled procedure each week that builds this weeks dataset of employees and then I need to have each of the employees receive an email but I cannot use the email stored proc inline with the scheduled SELECT statement. This would be possible using a function but I am using EXEC msdb.dbo.sp_send_dbmail to send mail which cannot be executed in a function. 回答1: Use a stored