input character string does not follow style 112, either change the input ch

  • EamonSQL

    SSCrazy

    Points: 2298

    Hi,

    I'm getting an obscure issue when

    when I run this SQL statement

    SELECT  TOP 1 S_Date from tbl_name order by RowID

    I get  this error message :

    Msg 9807, Level 16, State 0, Line 1

    The input character string does not follow style 112, either change the input character string or use a different style.

    but it is OK when I leave out the "order by RowID".

    Both SQL Statements will return the same first row and the value of S_Date is NULL and is of type date

    Any help welcome!!!

    Thanks,

    Eamon

     

     

  • Phil Parkin

    SSC Guru

    Points: 244449

    What is the DataType of RowId?

    If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.
    See https://www.sqlservercentral.com/articles/forum-etiquette-how-to-post-datacode-on-a-forum-to-get-the-best-help/ for details of how to post T-SQL code-related questions.

  • frederico_fonseca

    SSChampion

    Points: 14651

    are you sure that tbl_name  is really a table and not a view?

    that SQL so simple would give that error if it was from a view with invalid data on the underlying table(s)

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply