In SQL Server, the DATETIME2FROMPARTS()
function works similar to the DATETIMEFROMPARTS()
function, except that it accepts 8 arguments and returns a datetime2 value. The DATETIMEFROMPARTS()
function on the other hand, accepts just 7 arguments and it returns a datetime value.
Basically, you provide all the date/time parts and this function will return a datetime2 value based on the parts you provide.