开发者

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

开发者 https://www.devze.com 2023-02-12 00:58 出处:网络
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开发者_如何转开发

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)


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]


Here's my msdb's [sp_send_dbmail] stored proc on PasteBin. Taken from SQL Server 2008 SP1.

The INSERT statement curiously doesn't include a value for last_mod_user! Line 364 on PasteBin.

Your error sounds correct; the field last_mod_user is defined as non nullable.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号