1
데이터베이스 메일을 통해 파일을 보내려고하는데 @query 옵션 메일없이 아래 쿼리를 실행할 때 메일이 트리거되지만 @query 옵션을 포함하면 오류가 발생합니다.데이터베이스를 통해 파일 보내기
if @@rowcount >0
EXEC msdb.dbo.sp_send_dbmail @profile_name = ' Errormail',@recipients='[email protected];',
@subject = 'A new Record created in the SSORunError Log Table' ,
@body = 'A new Record created in the SSORunError Log Table' ,
@query = 'select * from ip',
@attach_query_result_as_file = 1,
@query_result_width = 4000,
@query_attachment_filename = 'Details.txt'
오류 메시지 : 사전에
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 504
Query execution failed: Msg 208, Level 16, State 1, Server , Line 1
Invalid object name 'ip'.
감사
테이블의 완전한 이름을 사용해보십시오
gThanks 많이 .. –
오신 것을 환영합니다. 기꺼이 도와 드리겠습니다 ... –