SQL Server 2008 dbmail错误sp_send_dbmail - 无法将null值插入表sysmail_mailitems中的'last_mod_user'

StackOverflow https://stackoverflow.com/questions/5021269

我们的dbmail被带来了,我正在尝试解决这个问题。

我最近重新创建了sp_send_dbmail,但我没有在表msdb.dbo.sysmail_mailitems中的last_mod_user列中的空值(错误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.

enter image description here

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top