Home All Groups Group Topic Archive Search About

IF Update(@ColName) won't work...

Author
23 Mar 2006 2:39 PM
Charlie@CBFC
Hi:

Inside a trigger I would like to check if a field changed using Update()
function.  However, the field name will stored in a variable, but IF
Update(@ColName) doesn't work.  Why won't Update() accept a variable
argument?

Thanks,
Charlie

Author
23 Mar 2006 3:10 PM
ML
And how do you dynamically determine which columns need to be tracked - i.e.
how does the column name end up in this variable?

Perhaps you'd get better help if you explain what you want to achieve,
rather than trying to explain how.


ML

---
http://milambda.blogspot.com/
Author
23 Mar 2006 3:50 PM
Aaron Bertrand [SQL Server MVP]
The same reason you can't say CREATE TABLE @TableName.

http://www.sommarskog.se/dynamic_sql.html


Show quote
"Charlie@CBFC" <fineblu***@verizon.net> wrote in message
news:euEL5eoTGHA.4956@TK2MSFTNGP09.phx.gbl...
> Hi:
>
> Inside a trigger I would like to check if a field changed using Update()
> function.  However, the field name will stored in a variable, but IF
> Update(@ColName) doesn't work.  Why won't Update() accept a variable
> argument?
>
> Thanks,
> Charlie
>

AddThis Social Bookmark Button