Trigger...

05/17/2017 19:30 -Prestige..#1
Code:
ALTER trigger [dbo].[PrestigePoints] 
ON [PRESTIGE].[dbo].[*Prestige] 
After UPDATE AS 
DECLARE [MENTION=339086]Reason[/MENTION] varchar(max) 
Select [MENTION=339086]Reason[/MENTION]= COLUMN_NAME from INFORMATION_SCHEMA.COLUMNS 
--update PRESTIGE.dbo.[*Prestige] set [JOB|Death]=[JOB|Death]+1 where [MENTION=643446]killed[/MENTION]Name=CharName 
DECLARE [MENTION=395373]Chari[/MENTION]D int 
Select [MENTION=395373]Chari[/MENTION]D=CharID from PRESTIGE.dbo.[*Prestige] 
DECLARE [MENTION=505066]point[/MENTION] int 
Select [MENTION=505066]point[/MENTION]=Points from PRESTIGE.dbo.[LIST|PrestigePoints] Where Reason [MENTION=339086]Reason[/MENTION] 
BEGIN 
EXEC SRO_VT_ACCOUNT.CGI.CGI_PrestigePoints [MENTION=395373]Chari[/MENTION]D [MENTION=505066]point[/MENTION] 
END


I'd like to Select @[Only registered and activated users can see links. Click Here To Register...] >> The column name which is updated


but using that >> Select @[Only registered and activated users can see links. Click Here To Register...]= COLUMN_NAME from INFORMATION_SCHEMA.COLUMNS .. doesn't do the job ?
05/17/2017 21:10 B1Q#2
set @[Only registered and activated users can see links. Click Here To Register...] = (select Reason from inserted)
05/17/2017 21:24 -Prestige..#3
Quote:
Originally Posted by B1QB0SS :3 View Post
set @[Only registered and activated users can see links. Click Here To Register...] = (select Reason from inserted)
Well the inserted line is like >>
Update xxxx set vv=vv+1 where zz=zz

how can i capture that "vv" ?


Edit >> That "vv" is a column name? .. so ..
Set @[Only registered and activated users can see links. Click Here To Register...] = COLUMN_NAMEorsmth from inserted .
is not working.. i tried everything ...
am not that expert .. but i can work around things ..
05/17/2017 21:33 B1Q#4
dude wtf are you talking about!
it's like this

select @[Only registered and activated users can see links. Click Here To Register...]omk = mycoluimn from inserted
05/17/2017 22:27 -Prestige..#5
Quote:
Originally Posted by B1QB0SS :3 View Post
dude wtf are you talking about!
it's like this

select @[Only registered and activated users can see links. Click Here To Register...]omk = mycoluimn from inserted
[Only registered and activated users can see links. Click Here To Register...]


what is the damn statement ? ?

---------------------------------------------------------------------------------------------
in other words, how can i capture the name of column which is being updated?
05/17/2017 23:28 ​Exo#6
Quote:
Originally Posted by -Prestige.. View Post
[Only registered and activated users can see links. Click Here To Register...]


what is the damn statement ? ?

---------------------------------------------------------------------------------------------
in other words, how can i capture the name of column which is being updated?
Okay I am gonna assume that you have pretty stupid structure for a very simply operation.

Please post a picture of the table.
05/18/2017 01:05 B1Q#7
oh... ok check
UPDATE(COLUMN_NAME) it returns boolean
true: if the column name specified was updated

it will return TRUE for all columns on insert hh :)

USAGE:
IF (UPDATE(MYCOLUMN))
BEGIN
-- MYCOLUMN WAS UPDATED
END