String_To_DateTime2

Retrieves a datetime2 value from a string.

  • Free Function
  • SQL Server Compatibility: 2008, 2012, 2014, 2016, 2017

Syntax:

SELECT SQLHTTP.net.String_To_DateTime2 ( @String )

Arguments:

Name Type Description
@String varchar(MAX) Any character string, variable, or expression.

Return Type:

datetime2

Remarks:

This powerful function is able to convert strings to dates in many uncommon formats. However, it is relatively slow so use sparingly.

Sample Usage:

See Also: