Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


TinyInt to Unique Identifer


TinyInt to Unique Identifer

Author
Message
Charmer
Charmer
SSC Eights!
SSC Eights! (834 reputation)SSC Eights! (834 reputation)SSC Eights! (834 reputation)SSC Eights! (834 reputation)SSC Eights! (834 reputation)SSC Eights! (834 reputation)SSC Eights! (834 reputation)SSC Eights! (834 reputation)

Group: General Forum Members
Points: 834 Visits: 1013
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
SQLRNNR
SQLRNNR
SSC-Insane
SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)

Group: General Forum Members
Points: 21073 Visits: 18259
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

Charmer
Charmer
SSC Eights!
SSC Eights! (834 reputation)SSC Eights! (834 reputation)SSC Eights! (834 reputation)SSC Eights! (834 reputation)SSC Eights! (834 reputation)SSC Eights! (834 reputation)SSC Eights! (834 reputation)SSC Eights! (834 reputation)

Group: General Forum Members
Points: 834 Visits: 1013
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
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search