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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SQL SERVER trigger

Author  Topic 

manasbagde
Starting Member

11 Posts

Posted - 2010-10-14 : 12:24:53
Could some one let me know what the below trigger will do?

use default_epayments_db
CREATE TRIGGER EBS_Update_URL
ON
REQ
FOR INSERT
AS
BEGIN
IF EXISTS(SELECT RQ_REQUEST_ID, RQ_REQUEST_SERVER FROM REQ
WHERE RQ_REQUEST_SERVER = 'https://employeerequest-qa.emdeon.net/itg/')
BEGIN

update REQ set RQ_REQUEST_SERVER= 'http://10.145.176.21:8080/itg'

END
END


Regards,
Manas

--Manas

Kristen
Test

22859 Posts

Posted - 2010-10-14 : 12:47:04
When a row(s) are inserted into table REQ, regardless of the values in that row(s), if a row exists in REQ where RQ_REQUEST_SERVER = 'https://employeerequest-qa.emdeon.net/itg/' then RQ_REQUEST_SERVER will be set to 'http://10.145.176.21:8080/itg' for every row in table REQ.

I very much doubt this is the intended behaviour (unless there is a constraint that only allows there to be one row in REQ table, or somesuch)
Go to Top of Page

manasbagde
Starting Member

11 Posts

Posted - 2010-10-15 : 02:46:26
Thanks Kristen

--Manas
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-10-15 : 02:50:04
Sachin.Nand has already given a solution in this thread:
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=151560

So what is your problem?


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -