DB changes how to call an ASP/MTS obj

Results 1 to 3 of 3

Thread: DB changes how to call an ASP/MTS obj

  1. #1
    GKM Guest

    Default DB changes how to call an ASP/MTS obj

    I wanna know how an ASP file and/or an MTS object can be called<BR>when there is a change in my database(MS SQL table)<BR>Thanks in advance<BR>GKM<BR>gibumathew@hotmail.com

  2. #2
    Join Date
    Dec 1969

    Default RE: DB changes how to call an ASP/MTS obj

    Good luck on this one...(I don&#039t know if this will work or not but it&#039s worth a shot)<BR><BR>If you have SQL 7 you can try this: <BR>Step 1. Create a trigger on the table(s) you want to monitor for the events you want to monitor (insert, update, delete). An update trigger can be as simple as:<BR>create trigger tu_acts on [acts] for update as<BR>if update(actname) raiserror(50001,10,1)<BR>**The raiserror is the key to the whole thing. 50001 is a user defined error in SQL and the 10 says that it&#039s an information message.<BR><BR>Step 2. Create the job that will run what you want. You can have a job execute vbscript but I&#039m not sure if the scope of the script is limited to the server database or to the operating system. You can also have the job execute a program. <BR>Step 2a. Give the job a name and set the category to Uncategorized (Local)<BR>Step 2b. Add a job step and set the type to Active Script. Click open to select the script you want to run.<BR>Step 2c. Add the schedule. That&#039s actually a bit misleading since it&#039s not a schedule. It&#039ll get fired off every time a stored proc raises the custom error you specified in the trigger step 1. Click the New Alert button, give the new alert a name, click the error number radio button and enter 50001. When you click OK you will be asked it you always want the error to invoke the alert, answer yes.<BR><BR>Now whenever you update the table the trigger will send a raiserror of 50001 back to the engine which will in turn fire off the job you created.<BR><BR>Good luck and let me know what happens.<BR>-Jeff

  3. #3
    GKM Guest

    Default RE: DB changes how to call an ASP/MTS obj

    Thanks for your feedback Jeff.Guess I don&#039t want a database specific action feature. About the comp getting called everytime an error occurs might be a problem.Will check out and get back<BR>Thanks again<BR>GKM

Posting Permissions

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