22 Eylül 2010 Çarşamba

Msg 515, Level 16, State 2, Procedure sp_validate_user, Line 19 Cannot insert the value NULL into column 'permission path', table '@temp'; column does

HATA:
Msg 515, Level 16, State 2, Procedure sp_validate_user, Line 19
Cannot insert the value NULL into column 'permission path', table '@temp'; column does not allow nulls. INSERT fails.
The statement has been terminated.
Msg 14607, Level 16, State 1, Procedure sp_send_dbmail, Line 136
profile name is not valid

AÇIKLAMA:
Ben bu hata ile, ilgili sunucudan aşağıdaki koda benzer bir kod ile Database Mail vasıtasıyla eposta göndermeye çalışırken karşılaştım:

Örnek Kod:
EXECUTE msdb.dbo.sp_send_dbmail
@profile_name = 'SMTP'
,@recipients = 'ekrem.onsoy@test.com'
,@body = 'test_mesaj'
,@subject = 'test_konu'


Bahsi geçen SQL Server Instance'ında iki tane Database Mail Profile ve Account'u mevcuttu.

ÇÖZÜM:
Sorun, iki Database Mail Profile'ının da Public olmamasıydı. Yukarıdaki örnekte de kullanılan "SMTP" isimli Database Mail Profile'ı da Public değildi.

Ya ilgili Database Mail Profile'ını Public olarak ayarlayın ya da ilgili Login'i Private Database Mail Profile'ını kullanabilecek şekilde ayarlayın.

Bu ayarları da ister T-SQL ile isterseniz de SQL Server Management Studio aracılığıyla yapabilirsiniz. Değişikliği SSMS'ten yapmak için: Object Explorer->Management->Database Mail->Manage Profile Security->Public Profiles\Private Profiles.

Hiç yorum yok: