Click here to Skip to main content
15,914,165 members
Home / Discussions / Database
   

Database

 
AnswerRe: Doubt in query........., Pin
N a v a n e e t h16-Jul-07 20:37
N a v a n e e t h16-Jul-07 20:37 
GeneralRe: Doubt in query........., Pin
Member 387988116-Jul-07 20:57
Member 387988116-Jul-07 20:57 
AnswerRe: Doubt in query........., Pin
Krish - KP16-Jul-07 21:20
Krish - KP16-Jul-07 21:20 
GeneralRe: Doubt in query........., Pin
RepliCrux17-Jul-07 12:40
RepliCrux17-Jul-07 12:40 
GeneralRe: Doubt in query........., Pin
Krish - KP17-Jul-07 20:34
Krish - KP17-Jul-07 20:34 
QuestionQuery Pin
samerh16-Jul-07 18:42
samerh16-Jul-07 18:42 
AnswerRe: Query Pin
andyharman16-Jul-07 19:44
professionalandyharman16-Jul-07 19:44 
QuestionTriggers Pin
seemamltn16-Jul-07 11:32
seemamltn16-Jul-07 11:32 
Hi All,

I have a table with some columns. My project is when I upade any of the
column then I want a trigger to execute in a column named DATE_UPDATED. i
have the following trigger but when I update any column it doesn't allow me
to update the table manually. Where is the problem. e.g if I try to update
column name ADDRESS1 it gives the error message
ERROR MESSAGE = The transaction ended in the trigger. The batch has been
aborted.
Here is my trigger.
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go


ALTER TRIGGER [trgUddated]

ON [dbo].[DELTA_CARRIER]

FOR UPDATE

AS

If UPDATE(CARRIER_NAME)

BEGIN

PRINT('AFTER Trigger [trgUddate] - Executed - Carrier Name has
been updated')

ROLLBACK TRANSACTION

END

else If UPDATE(ADDRESS1)

BEGIN

PRINT('AFTER Trigger [trgUddate] - Executed - Address1 has been
updated')

ROLLBACK TRANSACTION

END

else If UPDATE(ADDRESS2)

BEGIN

PRINT('AFTER Trigger [trgUddate] - Executed - Address2 Name has
been updated')

ROLLBACK TRANSACTION

END

else If UPDATE(CITY)

BEGIN

PRINT('AFTER Trigger [trgUddate] - Executed - City has been
updated')

ROLLBACK TRANSACTION

END
else If UPDATE(STATE)

BEGIN

PRINT('AFTER Trigger [trgUddate] - Executed - State Name has
been updated')

ROLLBACK TRANSACTION

END

else If UPDATE(ZIP_CODE)

BEGIN

PRINT('AFTER Trigger [trgUddate] - Executed - Zip code has been
updated')

ROLLBACK TRANSACTION

END
else If UPDATE(PHONE)

BEGIN

PRINT('AFTER Trigger [trgUddate] - Executed - Phone Name has
been updated')

ROLLBACK TRANSACTION

END
UPDATE DELTA_CARRIER

SET DATE_UPDATED = GETDATE()

WHERE CARRIER_ID = 7551


seema

AnswerRe: Triggers Pin
andyharman16-Jul-07 20:27
professionalandyharman16-Jul-07 20:27 
QuestionQuery Help Pin
Hulicat16-Jul-07 9:40
Hulicat16-Jul-07 9:40 
AnswerRe: Query Help Pin
Hulicat16-Jul-07 11:44
Hulicat16-Jul-07 11:44 
QuestionOracle Network Conn Sting Pin
kallileo16-Jul-07 6:15
kallileo16-Jul-07 6:15 
AnswerRe: Oracle Network Conn Sting Pin
Paul Conrad16-Jul-07 8:32
professionalPaul Conrad16-Jul-07 8:32 
GeneralRe: Oracle Network Conn Sting Pin
kallileo16-Jul-07 20:55
kallileo16-Jul-07 20:55 
QuestionGrouping in Microsoft Reporting Service Pin
Rupesh Kumar Swami16-Jul-07 5:21
Rupesh Kumar Swami16-Jul-07 5:21 
QuestionDistinct in Quey Pin
Khan.Bangash16-Jul-07 3:58
Khan.Bangash16-Jul-07 3:58 
AnswerRe: Distinct in Quey Pin
Colin Angus Mackay16-Jul-07 5:00
Colin Angus Mackay16-Jul-07 5:00 
GeneralRe: Distinct in Quey Pin
Khan.Bangash16-Jul-07 5:08
Khan.Bangash16-Jul-07 5:08 
AnswerRe: Distinct in Quey Pin
andyharman16-Jul-07 5:11
professionalandyharman16-Jul-07 5:11 
GeneralRe: Distinct in Quey Pin
Khan.Bangash16-Jul-07 5:17
Khan.Bangash16-Jul-07 5:17 
GeneralRe: Distinct in Quey Pin
Blue_Boy16-Jul-07 5:26
Blue_Boy16-Jul-07 5:26 
QuestionUpdating Bulk Record in oracle 10 g, Pin
nabeelkhan16-Jul-07 1:34
nabeelkhan16-Jul-07 1:34 
QuestionRe: Updating Bulk Record in oracle 10 g, Pin
andyharman16-Jul-07 5:17
professionalandyharman16-Jul-07 5:17 
QuestionDateTime Problem Pin
Mohammed Elkholy16-Jul-07 1:15
Mohammed Elkholy16-Jul-07 1:15 
AnswerRe: DateTime Problem Pin
Blue_Boy16-Jul-07 2:35
Blue_Boy16-Jul-07 2:35 

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.