Abdullah Jibaly
Abdullah Jibaly

Reputation: 54780

Triggering a stored procedure in SQL Server 2005 by email

How can I trigger a stored procedure in SQL Server 2005 based on emails arriving in an Exchange inbox (with POP3/IMAP enabled)? I'd rather not use Windows Services if possible, and use the SQL Server functionality instead.

Upvotes: 0

Views: 391

Answers (1)

Lucero
Lucero

Reputation: 60190

Exchange has Event Sinks which could write data to the DB. Sample: http://www.codeproject.com/KB/cs/csmanagedeventsinkshooks.aspx

Doing thins using SQL Server somehow or a Windows Service would require polling for changes, which is less efficient; either you consume much resources through intensive polling or you have some delay until you notice a new message. The event sinks are basically invoked right away, and depending on the sink you can even influence the message.

Upvotes: 1

Related Questions