问题
i want to send an email as a user inserts some data into a table. is this possible in sql express? please help with the code.
i would use a trigger for insertion on the table. for email what features shall i have on my PC. i have Windows XP.
回答1:
As far as I know, SQL Express does not support the Database Mail feature, so this would not be possible out of the box. As per the note at the bottom of the Database Mail MSDN article for Sql Server 2008 R2:
Database Mail is not available in SQL Server Express.
A more robust solution would be to embed the notification logic in the application tier (e.g C#) which talks to the database.
回答2:
As far as I didn't find any deprecation against enabling SQL CLR onto SQL Server Express,
you can try to use SQL CLR Trigger with System.Net.Mail
objects.
回答3:
This is not possible with SQL Express. If you happen to update to the full management studio you would use msdb.dbo.sp_send_dbmail to send your email.
来源:https://stackoverflow.com/questions/5296032/send-email-from-sql-server-express