Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

TinyInt to Unique Identifer Expand / Collapse
Author
Message
Posted Wednesday, July 30, 2014 9:59 AM


Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Tuesday, October 28, 2014 8:16 AM
Points: 691, Visits: 766
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
Post #1597832
Posted Wednesday, July 30, 2014 10:26 AM This worked for the OP Answer marked as solution


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Yesterday @ 8:49 PM
Points: 17,967, Visits: 15,979
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
Post #1597849
Posted Wednesday, July 30, 2014 10:29 AM


Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Tuesday, October 28, 2014 8:16 AM
Points: 691, Visits: 766
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
Post #1597851
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse