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

  • 2 August 2023
  • 0 replies
  • 300 views

Userlevel 7
Badge

Example scenario: 

declare @id uniqueidentifier   = ‘123’ 
 
SELECT AccountId 
FROM [CData].[dbo].[Test] a 
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   = ‘123’ 

 

SELECT AccountId 

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

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


This topic has been closed for comments