TinyInt to Unique Identifer

  • Hello friends,

    I have a select statement with a WHERE clause filter.

    The column in the WHERE statement is a uniqueidentifier. The value is coming as an integer.

    So I get this kinda of error

    "Operand type clash: uniqueidentifier is incompatible with tinyint"

    The incoming value is jsut "176" but it must be "00000000-0000-0000-0000-000000000176"

    Is there any way that we can convert the integer to match with unique identifer.

    I am sorry that this may be a stupid question. But I just want to know if there is any solution available.

    Please share your comments.

    Thanks,
    Charmer

  • You cannot convert from tinyint to uniqueidentifier.

    You will need to rewrite your code to accept the correct data types or change the data type in the table.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • SQLRNNR (7/30/2014)


    You cannot convert from tinyint to uniqueidentifier.

    You will need to rewrite your code to accept the correct data types or change the data type in the table.

    Thank you for your suggestion. Now I am sure that this can not be possible.

    Thanks,
    Charmer

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

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