Posts

Showing posts from September, 2025

Notify Database Admin when a new record inserted in table in SQL Server

Introduction: Hello Guys, “ Welcome back” Today, i am here with another one new great article. In this article I explained the implementation about how to send notification or email to the Database Administrator (DBA) when user will be inserted a record in the Table with SQL Server database. Implementation: Through this article i will also explain that how to send email using Trigger using  sp_send_dbmail  Store Procedure in SQL Server which will send the notification or email to the Database Administrator (DBA) when user will be inserted the record in Table of the database. This article will capture the following SQL Server versions i.e. 2008, 2008R2, 2012, 2014, 2016, 2017, 2019 and 2022. Database I created a table user_details with the mentioned columns as follows. column name           data Type   user_id                 ...

Configure SQL Server for sending emails

Image
  Introduction: Hello Guys, “ Welcome back” Today, i am here with another one new great article. In this article I explained how to configure SQL Server for sending emails from Database. This article is suitable for the mentioned SQL Server versions i.e. 2008, 2008R2, 2012, 2014, 2016, 2017, 2019 and 2022. Unblocking the sp_send_dbmail Stored Procedure in SQL Server The very first phase is to unblock the Store Procedure sp_send_dbmail used for sending emails using SQL Server. If Store Procedure is blocked when it executed, You got below error. To unblock the Store Procedure, you just need to   copy, paste and execute the below SQL queries. USE   MASTER GO SP_CONFIGURE   'show advanced options' ,   1 RECONFIGURE   WITH   OVERRIDE GO   -- Unblocking sp_send_dbmail SP_CONFIGURE   'Database Mail XPs' ,   1 RECONFIGURE   WITH   OVERRIDE GO   SP_CONFIGURE   'show advanced options' , ...

Send email in SQL Server using Store Procedure

Introduction: Hello Guys, “ Welcome back” Today, i am here with another one new great article. In this article I explained the implementation about how to send email in SQL Server using Store procedure. Implementation: This article will explain that how to send email using sp_send_dbmail Store Procedure in SQL Server by using GMAIL SMTP settings. This article is applicable to following SQL Server versions i.e. 2008, 2008R2, 2012, 2014, 2016, 2017, 2019 and 2022. Configuring SQL Server for sending emails In order to start sending emails, the very first thing to be done is to configure SQL Server for sending emails from Database. I already explained about to configuration of SQL Server in my article . Sending Email using sp_send_dbmail Stored Procedure in SQL Server Once the SQL Server Database is configured, you are now ready to send emails. In the following SQL query, the SQL Server using Store Procedure sp_send_dbmail is used to send an email from SQL Server. EX...