• Still i failed to get desire result.

    /*

    The following example displays the current date and time, uses CAST to change the current date and time to a character data type, and then uses CONVERT display the date and time in the ISO 8901 format.

    */

    declare @dt date

    set @dt = '17-07-2016'

    SELECT

    @dt AS UnconvertedDateTime,

    CAST(@dt AS nvarchar(30)) AS UsingCast,

    CONVERT(nvarchar(30), @dt, 103) AS UsingConvertTo_ISO8601

    Msg 241, Level 16, State 1, Line 2

    Conversion failed when converting date and/or time from character string.