What are the advantages of using one over the other in the following:
DATEPART(YEAR, GETDATE())
As opposed to:
YEAR(GETDATE
There is no difference. In the execution plan both is translated to as datepart(year,getdate()).
datepart(year,getdate())
This is true for SQL Server 2005, 2008 and 2012.
select datepart(year, getdate()) from (select 1 x) x select year(getdate()) from (select 1 x) x
Execution plan.