SQL Server 2008 DBmail Error SP_SEND_DBMAIL - Não é possível inserir valor nulo em 'last_mod_user' na tabela sysmail_mailitems
-
14-11-2019 - |
Pergunta
Nosso dbmail foi feito e estou tentando resolver o problema.
Eu recentemente recentemente recriei sp_send_dbmail, mas não estou recebendo um erro ímpar sobre um valor nulo na coluna last_mod_user na tabela msdb.dbo.sysmail_mailitems (erro 515)
Solução
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]
Outras dicas
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.
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow