Year Part Update in sql DateTime Column

 Admin   
298 View    Feb 8 2020 2:32PM

Need to change only the year part of every ChangedDate Column to 2017. i.e
2017-02-08 13:55:30.193
2017-02-08 13:55:30.193
2017-02-08 13:55:30.193

 

 

Declare  @DateCol datetime='2020-02-08 13:55:30.193'

SELECT convert(varchar(50),DATEPART(YYYY,'2017-02-08')) +'-'

 + convert(varchar(50),DATEPART(mm, @DateCol))

+'-'+convert(varchar(50),DATEPART(dd, @DateCol))+ ' ' +

convert(char(12),cast(@DateCol as time))