Quantcast
Channel: Forum SQL Server Database Engine
Viewing all articles
Browse latest Browse all 15889

sp_send_dbmail won't take @query SQL 2005 64bit

$
0
0

I am trying to send query results via email. The command works fine without the @query parameter but gets the following error with it. No query works, I tried several as well as a select, all result in same message.

Works:

EXEC

msdb.dbo.sp_send_dbmail

@recipients='rmtest@dddd.com',

--@query = 'EXEC sp_who',

@subject='Work Order Count';

Does not work:

EXEC

msdb.dbo.sp_send_dbmail

@recipients='rmtest@dddd.com',

@query = 'EXEC sp_who',

@subject='Work Order Count';

Msg 22050, Level 16, State 1, Line 0

Error formatting query, probably invalid parameters

Msg 14661, Level 16, State 1, Procedure sp_send_dbmail, Line 495

Query execution failed: Msg 15404, Level 16, State 19, Server SQL44\DBINST, Line 1

Could not obtain information about Windows NT group/user 'DD\rmtest', error code 0x5.



Viewing all articles
Browse latest Browse all 15889

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>