sqlsql-server-2008sp-send-dbmaildbmail

sql server 2008 dbmail error sp_send_dbmail - cannot insert null value into 'last_mod_user' in table sysmail_mailitems


Our dbmail got hosed and I'm trying to resolve the issue.

I've recently recreated sp_send_dbmail, but am not getting an odd error regarding a null value in last_mod_user column in table msdb.dbo.sysmail_mailitems (error 515)


Solution

  • last_mod_user in msdb.dbo.sysmail_mailitems should have a default defined on it. Has that gone missing on your install?

    ALTER TABLE [dbo].[sysmail_mailitems] ADD  DEFAULT (suser_sname()) FOR [last_mod_user]