Run SQL Server UPDATE error

0

Running the update statement below is experiencing the following error. What can it be?

  

Msg 116, Level 16, State 1, Line 3   Only one expression can be specified in the select list when the subquery is not entered with EXISTS

UPDATE EstoqueTarefa 
SET EstTarTitulo = (SELECT CONCAT(EstTarTitulo, '-' ,DATENAME(MONTH,getdate())),'-',DATEPART(YEAR,getdate())) 
where EstTarID = 246 
    
asked by anonymous 13.10.2017 / 19:20

1 answer

0

The problem is in SubQuery, it only performs select field1, field2, etc. You do not need to use Select because the GETDATE () function can be invoked without problem.

SET EstTarTitulo = CONCAT(EstTarTitulo, '-' ,DATENAME(MONTH,getdate()),'-',DATEPART(YEAR,getdate()))
    
14.10.2017 / 16:44