Conversion failed when converting from a character string to uniqueidentifier?

I have a Customer table which has a copy of the Sphinx Id held in the field UserID. This is a NullableString in the Aurelius entity and a nvarchar(36) in the SQL Server database. For some reason SQL Server is trying to convert it.

Anyone have any workarounds for this? Using it in a SQL Server Management Studio query is fine.

Project AlphaManager.exe raised exception class EXDataGetRequestException with message 'XData server request error.
Uri: https://mydomain.com/Server/Customer?$filter=UserId eq a10417f0-623e-4772-b1b6-c28c7f041b83
Status code: 500
Error Code: MSSQLNativeException
[FireDAC][Phys][ODBC][Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Conversion failed when converting from a character string to uniqueidentifier.'.

Since the database field is nvarchar, it's a string, and you should unquote the value in the query as a string, as it's not a GUID:

https://mydomain.com/Server/Customer?$filter=UserId eq 'a10417f0-623e-4772-b1b6-c28c7f041b83'
1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.