所以,我有这个代码,用于一个过程。代码如下:
EXEC msdb.dbo.sp_send_dbmail
@profile_name = 'SQL-PHC',
@recipients = 'filipeferreira@mass.pt',
@query = 'SELECT no, nome, obrano, convert(varchar,datafinal)
FROM bo
WHERE nmdos LIKE "Preços por Cliente"
AND datafinal = DATEADD(day, -1, CONVERT(date, GETDATE()))' ,
@subject = 'Work Order Count',
@attach_query_result_as_file = 1 ;
当我解析代码时,一切正常,但是当我执行它时,出现以下错误:
Msg 22050, Level 16, State 1, Line 0
Failed to initialize sqlcmd library with error number -2147467259.
我真的不明白有什么问题或如何解决这个问题