خطأ SQL Server 2008 خطأ DBMAIL SP_SEND_DBMAIL - لا يمكن إدراج قيمة فارغة في "last_mod_user" في Syssmail_mailitems

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

سؤال

حصلت على dbmail لدينا، وأنا أحاول حل المشكلة.

لقد قمت مؤخرا بإعادة إنشاء 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