SQL Server 2008 Errore DBmail Sp_Send_dbmail - Impossibile inserire il valore nullo in 'last_mod_user' nella tabella sysmail_mailtems
-
14-11-2019 - |
Domanda
Il nostro dbmail è stato osso e sto cercando di risolvere il problema.
Ho recentemente ricreato sp_send_dbmail, ma non sto ottenendo un errore dispari per quanto riguarda un valore null nella colonna di last_mod_user nella tabella msdb.dbo.sysmail_mailtems (errore 515)
Soluzione
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]
Altri suggerimenti
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.
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow