Skip to content

Instantly share code, notes, and snippets.

@codenamejason
Created January 2, 2018 16:19
Show Gist options
  • Save codenamejason/d0f16c0a1e3c265dca0aed7c73356ba0 to your computer and use it in GitHub Desktop.
Save codenamejason/d0f16c0a1e3c265dca0aed7c73356ba0 to your computer and use it in GitHub Desktop.
create function dbo.string2Date(@myDate nchar(50))
returns datetime
as
begin
if isDate(@myDate) = 1
return cast(@myDate as datetime)
return null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment