Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

SQL SERVER 2005 Daily Job

Posted on 2007-03-27
1
Medium Priority
?
265 Views
Last Modified: 2007-03-27
Hello -how would I set up to run this script everyday at 8:00am on a SQL Server 2005

Thanks JK




IF EXISTS (SELECT 1 FROM Settlement WHERE
DateStampTxt <= CAST(CONVERT(varchar,GETDATE() -1, 112) AS DATETIME) and Sitetxt = 2 and PrimaryKey = (Select Max(PrimaryKey) from Settlement where SiteTxt=2))
BEGIN
declare @body1 varchar(100)
set @body1 = ' ELLENGTON HAS NOT SUBMITED A NIGHT AUDIT'
EXEC msdb.dbo.sp_send_dbmail @recipients='test@test.com',
    @subject = 'Night Audit',
    @body = @body1,
    @body_format = 'HTML';
END
0
Comment
Question by:fsuedu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 2000 total points
ID: 18801217
you need to create a job for this purpose

http://msdn2.microsoft.com/en-us/library/ms186273.aspx
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Windocks is an independent port of Docker's open source to Windows.   This article introduces the use of SQL Server in containers, with integrated support of SQL Server database cloning.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how the fundamental information of how to create a table.

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question