Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2005-10-12 : 08:14:39
|
| Teresa writes "Hello:Our university is using SQL Server 2000 to store data from the online application form the applicants use to apply to the university. When the Submit application button is clicked it directs you to the confirmation page displaying the submission id. It all worked fine until I created a trigger on the AAIAP table, the code is below:if exists (select name from sysobjects where name = 'tgOther_FirstName' and type = 'tr') drop trigger tgOther_FirstNameGOCREATE TRIGGER tgOther_FirstNameon AAIAPfor INSERTASif exists (SELECT * FROM inserted where OTHERLASTNAMES > '')BEGINUPDATE AAIAPSET OTHERFIRSTNAMES = FIRSTNAMEENDthe purpose of the trigger was to store the firstname value in otherfirstname field, whenever otherlastname is entered on the web form. All fields come from the same AAIAP table.The trigger completes that part successfully, I can see firstname stored in otherfirstname, but clicking Submit Application does not direct me to the confirmation page.Could you help me to figure out why the trigger updates the table, saves data in the database, but does not direct me to the confirmation page?Thank you,Teresa SkoraAnalyst Programmer" |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-10-12 : 08:25:46
|
| After the Trigger is fired, you need to query Select statement to get the updated resultMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|