Home Forums SQL Server 2008 T-SQL (SS2K8) Need to find out whether date is of which data type RE: Need to find out whether date is of which data type

  • anthony.green (1/8/2013)


    With difficulty

    You could do a check in the string for the + or - symbol to indicate Offset

    You could then do a check for a : to detail if a time has been put in the string for datetime

    You could check the length of the variable is 10, if the date has been provided only

    If user passes a string value with all these special characters will lead to wrong check.

    eg: 'sdfsdfsfs:sdfsf', '2323232:2323:23:23 +2323'