0
When the update below is run for the first time, the field comes out correctly in the way I want it to be below, but if I run it again, it comes out that way. What I want is that regardless of how many times the script is executed, do not duplicate the month or the year.
(WRONG) Tartitulo Strategic Assisted Production October-2017October-2017
(CORRECT) Tartitulo Strategic Assisted Production October-2017
Update script
UPDATE EstoqueTarefa
SET EstTarTitulo = (SELECT CONCAT(EstTarTitulo,DATENAME(MONTH,getdate()),'-',DATEPART(YEAR,getdate())))
WHERE EstTarID = 246
You cannot add a column indicating that the title is up to date?
– Sorack
no, no @sorack
– Renan Bessa
Give an example of the data with at least 2 records and how they will look after each
update
. It is impossible to understand what you want by the current description– Sorack
@Sorack, come on, below is the example of a record without the update in the table stocking in the field esttartitulo Example without the update Esttartitulo Strategic Assisted Production is to look like this: Esttartitulo Strategic Assisted Production NOVEMBER - 2017 Example right after the update is running in November, is to look like this: Esttartitulo Strategic Assisted Production DECEMBER - 2017 And so on and so forth.
– Renan Bessa
@Sorack, I managed to settle here my dear. Thank you
– Renan Bessa