Update a table from a join I have a table GEMS_PROJECTS:

du_proj_id
du_id
Proj_id
proj_desc
isactive
transuser
trandate


A second table GEMS_DEPARTMENT:

du_proj_id
dept_id
de_dec
isactive
transuser
trandate


du_proj_id from second table refers to du_id from first table and I need update second table isactive field.

Note duid getting from user to pass first table and second table.
I assume you are trying to set isactive in the department table to the same value currently in projects, for all rows involving the specified duid.

UPDATE d
  SET isactive = p.isactive
FROM dbo.GEMS_DEPARTMENT AS d
INNER JOIN dbo.GEMS_PROJECTS AS p
ON RTRIM(d.du_proj_id) = p.du_id
WHERE p.du_id = @duid;


The most common answer for this problem is found here.