Hi,I don't understand why I am getting an error when I try to run the following statement. I am a SysAdmin and so is the service account the agent runs under. I have tried selecting another table and column and splat and I got the same error. EXEC [msdb].[dbo].[sp_send_dbmail] @profile_name = 'DBA TEAM', @subject = 'DBCC Results', @recipients = 'lmacdonald@mywebgrocer.com', @query = 'SELECT MessageText FROM MyWebGrocerUtility.dbo.dbcc_history', @body_format = 'HTML';Msg 22050, Level 16, State 1, Line 0Failed to initialize sqlcmd library with error number -2147467259.The actual query I am trying to run is below. However I have made it much simpler hoping to slowly to work my way towards it to pin point the issue but it seems any select statement fails.SELECT TimeStamp, DB_NAME(dbid) + ' ' + MessageText FROM MyWebGrocerUtility.dbo.dbcc_history WHERE error = 8989 and timestamp >= dateadd(dd,-3,getdate())Thanks for any help, it's getting me very frustrated.
↧