# Error message code 500: Could not execute the specified command: Unknown datatype: unique identifier.

**URL:** <https://community.cdata.com/t/error-message-code-500-could-not-execute-the-specified-command-unknown-datatype-unique-identifier/307>\
**Category:** Editions\
**Tags:** article, sql-gateway, odbc, linked-server, ssms\
**Created:** [August 2, 2023, 6:05pm UTC](https://community.cdata.com/t/error-message-code-500-could-not-execute-the-specified-command-unknown-datatype-unique-identifier/307 "2023-08-02T18:05:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luçjano\_Capo](https://sea3.discourse-cdn.com/cdata/user_avatar/community.cdata.com/lu%C3%A7jano_capo/32/1638_2.png) [@Luçjano\_Capo](https://community.cdata.com/u/Lu%C3%A7jano_Capo)\
**Post date:** [August 2, 2023, 6:05pm UTC](https://community.cdata.com/t/error-message-code-500-could-not-execute-the-specified-command-unknown-datatype-unique-identifier/307/1 "2023-08-02T18:05:43Z")

</div>

Example scenario:

declare @id uniqueidentifier   = ‘123’&nbsp;  
&nbsp;  
SELECT AccountId&nbsp;  
FROM [CData].[dbo].[Test] a&nbsp;  
WHERE a.AccountId = @id

- The driver is avoiding this process since the conversion is not supported in SQL Server.

- To address this issue, you will have to use cast to complete the execution. The example scenario should now look like this:

declare @id uniqueidentifier&nbsp;&nbsp; = ‘123’

SELECT AccountId

FROM [CData].[dbo].[Test] a

WHERE a.AccountId = cast(@id as varchar(255))
