Thursday, February 16, 2012

comment

I am trying to update a field called NodeName from [Table A] to add the
characters "?BadLink" to the end of the NodeName based on NodeID being equal
to [Table B].NodeName. How can I do this?
Example
TableA.NodeID=12345 and TableB.NodeID=12345
update the nodename "NameoftheNode" in table A to be "NameoftheNode?BadLink"Update TableA
set NodeName=NodeName + '?BadLink'
where NodeID in
(select NodeID from TableB
where NodeID=12345 --use this line if you want to update one row at a time
)
or
Update TableA
set TableA.NodeName=TableA.NodeName + '?BadLink'
from TableA, TableB
where TableA.NodeID=TableB.NodeID
and TableB.NodeID=12345 --use this line if you want to update one row at a
time
"Andy" wrote:

> I am trying to update a field called NodeName from [Table A] to add the
> characters "?BadLink" to the end of the NodeName based on NodeID being equ
al
> to [Table B].NodeName. How can I do this?
> Example
> TableA.NodeID=12345 and TableB.NodeID=12345
> update the nodename "NameoftheNode" in table A to be "NameoftheNode?BadLin
k"
>

No comments:

Post a Comment