We help IT Professionals succeed at work.
Get Started

How to create a Package that retrieves records and sends a message

Last Modified: 2012-07-10

I kindly request you to help me on how to create a simple package for the following senior, I'm new in this area and i did a workaround inside Business Intelligence Development Studio, it seems to me it is easy so far but after specifying for me which flows to use.

1-Open a connection to MS SQL Server R2
2-Choose a Table (In my senior it is one table)
3-Write a query

3.1- if the query retrieve records then do the following
            Send a Mail
            Write a DML like updating another table
            do nothing

3.2  This will be scheduled in the database to be run every minute (don't worry the DB   Administrator will take care after i send him the package file)

what flows to use and what about the query i'm using :

Four Main Columns:
Request NO
status    ------        Status has values like (Open =1, Closed=2, Canceled=3)
et          ----------    End Time
sdate     ------        Date

Select Count(*)
From Table
Where status = 1
            Server Time > et            
            Server Date = sdate
1- What is the right type of the server time and date, i'm using datetime2(7) for field End Time and Date for field sdate.

2- After i get a record with a status of Open, i need to change the record to a status of Closed to prevent the job from sending a message every minute, so where shall i write this DML statement:

UPDATE table
SET status = 2
WHERE   Server Time > et            
              Server Date = sdate
               status = 1

3- When sending the message how can i define or pass the request number field of that particular record in the message body.

Watch Question
This problem has been solved!
Unlock 1 Answer and 5 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE