SQL Server 2008 DBMail Ошибка SP_SEND_DBMAIL - не может вставить нулевое значение в «Last_Mod_user» в таблице SYSMAIL_MAILITEMS

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

Вопрос

Наш балд добмаил возился, и я пытаюсь решить проблему.

Я недавно воссоздал sp_send_dbmail, но не получаю странную ошибку в отношении нулевой стоимости в столбце Last_mod_user в таблице msdb.dbo.sysmail_mailitems (ошибка 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