August 6, 2010 at 9:47 pm
I have been tried send e-mail by using sp send_dbmail but i dont know why the @query param isn't fetching any record. The mail has been sent correctly when i'd tried send without @query param (just using @body), but using @query, the message are being sent empty. for example:
EXEC msdb..sp_send_dbmail
@profile_name='Farol',
@recipients='cci@goldfarb.com.br',
@query='SELECT Name FROM dbo.users',
@subject='Test'
The mail is arriving but without any results on the body.
Sorry for my english, i'm improving that!
Ty for advance.
August 6, 2010 at 11:35 pm
SELECT Name FROM YourDatabaseNameGoesHere.dbo.users
Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
Ramblings of a DBA (My SQL Server Blog)[/url]
Subscribe to my blog
August 6, 2010 at 11:36 pm
Or use @execute_query_database.
Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
Ramblings of a DBA (My SQL Server Blog)[/url]
Subscribe to my blog
August 9, 2010 at 5:53 am
basically your query SELECT Name FROM dbo.users
will be executed in msdb database thats why you are not getting results
-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done;-)
August 9, 2010 at 4:51 pm
OK. Excelent. It working fine now.
Ty all
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply