Click here to Skip to main content
15,903,724 members
Home / Discussions / Database
   

Database

 
AnswerRe: Creating a sql server data dictionary for our corporation? Pin
User 17164929-Nov-06 14:28
professionalUser 17164929-Nov-06 14:28 
QuestionCalling Procedures Pin
Dayekh9-Nov-06 3:07
Dayekh9-Nov-06 3:07 
AnswerRe: Calling Procedures Pin
Eric Dahlvang9-Nov-06 3:33
Eric Dahlvang9-Nov-06 3:33 
GeneralRe: Calling Procedures Pin
Dayekh9-Nov-06 3:52
Dayekh9-Nov-06 3:52 
GeneralRe: Calling Procedures Pin
indianet9-Nov-06 6:53
indianet9-Nov-06 6:53 
GeneralRe: Calling Procedures Pin
Eric Dahlvang9-Nov-06 9:25
Eric Dahlvang9-Nov-06 9:25 
GeneralRe: Calling Procedures Pin
Dayekh9-Nov-06 23:19
Dayekh9-Nov-06 23:19 
QuestionHow to merge two triggers to one Pin
andreas_6359-Nov-06 1:55
andreas_6359-Nov-06 1:55 
Hi,
i would like to ask how we can unify two triggers!
In first trigger i want to do something when a column is updated and in the other trigger i want to do something else when a different column is updated at the same table.
Now i have the two triggers and they are working properly, but i still have to do it in the same trigger!
Does anyone know how to do it!

CREATE TRIGGER UPDATE_REST1
ON [DBO].[FINTRADE]
FOR UPDATE
AS
IF UPDATE(FTRIDPAYMENT)
UPDATE FINTRADE
SET Z_YPOLOIPO= (SELECT ISNULL(I.TOTLAMOUNT,0) - ISNULL(PLH.TOTLAMOUNT,0) AS Z_YPOLOIPO
FROM INSERTED I, FINTRADE PLH
WHERE I.FTRIDPAYMENT=PLH.ID)
FROM FINTRADE F, INSERTED I
WHERE F.ID=I.ID


CREATE TRIGGER UPDATE_REST2
ON [DBO].[FINTRADE]
FOR UPDATE
AS
IF UPDATE (TOTLAMOUNT)
UPDATE FINTRADE
SET Z_YPOLOIPO= (SELECT ISNULL(PAR.TOTLAMOUNT,0) - ISNULL(I.TOTLAMOUNT,0) AS Z_YPOLOIPO
FROM INSERTED I, FINTRADE PAR
WHERE PAR.FTRIDPAYMENT=I.ID)
FROM FINTRADE F, INSERTED I
WHERE F.FTRIDPAYMENT=I.ID




Thanks in advance!

andreas
AnswerRe: How to merge two triggers to one Pin
Eric Dahlvang9-Nov-06 3:11
Eric Dahlvang9-Nov-06 3:11 
GeneralRe: How to merge two triggers to one Pin
andreas_6359-Nov-06 4:03
andreas_6359-Nov-06 4:03 
GeneralRe: How to merge two triggers to one Pin
Eric Dahlvang9-Nov-06 10:09
Eric Dahlvang9-Nov-06 10:09 
QuestionSign-On Question from Extreme Novice Pin
Jethro639-Nov-06 1:50
Jethro639-Nov-06 1:50 
AnswerRe: Sign-On Question from Extreme Novice Pin
Mike Dimmick9-Nov-06 6:07
Mike Dimmick9-Nov-06 6:07 
GeneralRe: Sign-On Question from Extreme Novice Pin
Jethro639-Nov-06 7:50
Jethro639-Nov-06 7:50 
Questionimage insertion in sqlserver Pin
yuvachandra9-Nov-06 1:13
yuvachandra9-Nov-06 1:13 
AnswerRe: image insertion in sqlserver Pin
saqib829-Nov-06 20:56
saqib829-Nov-06 20:56 
QuestionSQL Query ?? Pin
tadhg889-Nov-06 0:53
tadhg889-Nov-06 0:53 
QuestionRemote data access Pin
kalyanchakravarthi8-Nov-06 22:27
kalyanchakravarthi8-Nov-06 22:27 
Questionlook ahead in SQL Server Reporting Services Pin
dove118-Nov-06 13:55
dove118-Nov-06 13:55 
QuestionAccess and comparing dates Pin
eggsovereasy8-Nov-06 11:18
eggsovereasy8-Nov-06 11:18 
AnswerRe: Access and comparing dates Pin
indianet8-Nov-06 11:37
indianet8-Nov-06 11:37 
GeneralRe: Access and comparing dates Pin
eggsovereasy9-Nov-06 3:26
eggsovereasy9-Nov-06 3:26 
GeneralRe: Access and comparing dates [modified] Pin
indianet9-Nov-06 7:06
indianet9-Nov-06 7:06 
QuestionDetecting if a database as been updated Pin
steve_rm8-Nov-06 5:24
steve_rm8-Nov-06 5:24 
AnswerRe: Detecting if a database as been updated Pin
Colin Angus Mackay8-Nov-06 6:14
Colin Angus Mackay8-Nov-06 6:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.