Hi,
I am new to SQL 2005.
I was trying to set up SQL agent to send a query result via email.
EXEC msdb.dbo.sp_send_dbmail
@recipients = 'user@company.com',
@query = 'SELECT * FROM msdb.dbo.DASD,
@subject = 'DB Space',
@attach_query_result_as_file = 1 ;
The error message was:
Msg 102, Level 15, State 1, Line 4
Incorrect syntax near 'DB'.
Msg 105, Level 15, State 1, Line 4
Unclosed quotation mark after the character string ',
@attach_query_result_as_file = 1 ;
'.
Thank you for any suggestions
coady - 09 May 2008 00:38 GMT
Thank you. I figured it out.
It's @query = 'SELECT * FROM msdb.dbo.DASD',
not @query = 'SELECT * FROM msdb.dbo.DASD,
> Hi,
>
[quoted text clipped - 16 lines]
>
> Thank you for any suggestions