尝试加入:错误“从字符串转换为唯一标识符时转换失败。”

问题描述 投票:0回答:1

尝试加入两个 ID 字段时出现以下错误:

select top 10 *

from SOURCECODE as s

inner join APPEAL as a on s.APPEALID = a.APPEALID;

错误:

Conversion failed when converting from a character string to uniqueidentifier.

关于如何修复它有什么想法吗?

我需要转换字段吗?

s.appealid
nvarchar 36

a.appealid
uniqueidentifier

string join type-conversion uniqueidentifier
1个回答
-1
投票
SELECT TOP 10 *
FROM SOURCECODE AS s
INNER JOIN APPEAL AS a ON CONVERT(uniqueidentifier, s.APPEALID) = a.APPEALID;
© www.soinside.com 2019 - 2024. All rights reserved.