You must Sign In to post a response.
  • Category: SQL Server

    Sending Email via SQL Server jobs

    How to schedule a job for sending Email on daily basis in SQL server?
    Can anyone explain it step by step?
  • #765465
    basically you need to Open SQL Server Management Studio (SSMS), connect to the Database Engine, expand Management, right-click on Database Mail and then click Configure Database Mail.
    OR
    In order to send mail using Database Mail in SQL Server, there are 3 basic steps that need to be carried out:
    1.Create Profile and Account
    2.Configure Email
    3.Send Email
    see below link
    http://www.codeproject.com/Articles/29060/SQL-SERVER-Configure-Database-Mail-Send-Email

    Thanks
    Koolprasd2003
    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]

  • #765493

    Hi Kavipriya,

    Follow below steps :

    Step 1 :
    In the SQL Server Enterprise Manager expand the Management Tab and select SQL Server Agent Node.

    Step 2 :
    On the Right Panel Select Job, Right Click it and select New Job from context menu to open New Job Window.

    Step 3 :
    In the New Job Window, in General Tab enter the following details

    1. Name - Name of the Job
    2. Description – Description of the Job (Optional)
    3. Enabled – Determines whether job is enabled or disabled

    Step 4 :
    In the New Job Window, in Steps Tab click New Step to open a New Step Window

    In the New Step Window enter the following details

    1. Step Name - Name of the Step
    2. Type – Select Transact SQL Script
    3. Database – Select the database on which you want to run the script.
    4. Command – Paste the SQL Script which you wish the Job Scheduler to run.

    Step 5 :
    In the New Job Window, in Schedules Tab click New Schedule to open a New Schedule Window

    In the New Schedule Window enter the following details

    1. Name - Name of the Step
    2. Enabled – Determines whether Schedule is enabled or disabled
    3. Schedule Type – Select Recurring schedule type since we need to run it daily

    Step 6 :
    Next click on Change button in the Schedule Window to set the schedule

    In the Edit Schedule Window enter the following details

    1. Occurs – Daily since we need to run it daily
    2. Daily Frequency – Since we need to run once a day, select the time you wish to run
    3. Start date – Select date from when you want the schedule to run.


    Step 7 :

    That's it and your job is created. You will see a new entry in the SQL Server agent -----> Jobs

    To start the job right click the job and in the context menu click Start Job


Sign In to post your comments