Fokwa Best
Fokwa Best

Reputation: 3515

Conversion failed when converting from a character string to uniqueidentifier in SQL SERVER select statement

When I execute the query below, I get the error

Conversion failed when converting from a character string to uniqueidentifier.

SELECT * FROM TBL_IncidentDetails where IncidentId = '1822CBE-4616-4ABE-B562-D3CC925D68ED'

Below is my column data

enter image description here

Appreciate assistance

Upvotes: 0

Views: 407

Answers (1)

Thom A
Thom A

Reputation: 95561

Error is pretty clear, that value isn't a uniqueidentifier.

If you check against a proper GUID (i.e. SELECT NEWID() -> 919053E6-7CE6-4324-9A58-A2EACA5E0F5F) notice that the first "block" has 8 characters (919053E6). Yours, however, has 7 characters (1822CBE).

On consideration, this is probably simply a typographical error.

Upvotes: 1

Related Questions