Results 1 to 6 of 6

Thread: Trigger

  1. #1
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789

    Unanswered: Trigger

    I need to create a trigger or a stored procedure that will pop up when the users open up the database. it needs to be based on the DateSubmitted and if the Findings Field says "Yes". And as soon as the findings field says no then it will stop popping up. The reason for the datasubmitted is due to the amount of time they have to correct the findings, which will calculate 120 days from the DateSubmitted. I need it to calculate the DateSubmitted + 120 days and the results to populate in a field called the that will give them the date the finding Results are due, I need the datedue.

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Pop-up windows are the responsibility of your interface, not your database server. The best way to handle this is to add constraints to enforce referential integrity, and use the triggers only if your business rules cannot be encoded into a constraint.

    Your user interface can then interpret any error message returned by the server and generate an appropriate pop-up warning to the user.

    Again, pop-up windows and dialog boxes fall into the scope of the interface, and should not/cannot be coded into the database server.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  3. #3
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    To translate what blindman said into terms you might find more usable, the popup needs to be in the MDB or the ADP file. It needs to happen on the client side, when they run your application. It woud make no sense to pop up a window on the server when SQL started, there would probably be no one there to see it!

    -PatP

  4. #4
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    ...or more succinctly:

    SQL Server no do pop-ups.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  5. #5
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789

    Ok I see

    I explained it badly, sorry I thought about it and your correct thats not sql function. How about an xp_procedure that could email them the reports or can sql have outlook send them reminders, can sql have outlook send reminders to the users or email them reports with the beginning date and the ending date of the findings along with the department that needs to correct the findings. Is that possible. Your correct the launching would have to be done on the client side (software/GUI). Does that make sense

  6. #6
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    My first choice (based on what you've described) would be to use SQL Reporting Services to generate the report and send it as an email. That kind of assumes that you are using Reporting Services though.

    A simple query could be run as either a startup procedure, or better yet as a SQL Agent job, and it could send an email via xp_sendmail. Another option if you choose to use SQL Agent would be to have scheduled jobs for each potential recipient, or to have one scheduled job modify the email notification for another job, then launch that job.

    There are other tools that I'd probably use for this job, but that's because we've already got those tools. They'd be like using a bazooka to deal with flies for this problem.

    -PatP

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •