join - CONVERT- SQL Query -
select sd.sasid, s.siteid db1.site s left join db2.sasdata sd on convert(numeric(6), s.siteid) = sd.shipid
data type:
siteid - nvarchar(16)
shipid - numeric(6)
both siteid , shipid same entities of different datatypes , different databases. receiving 'error converting data type nvarchar numeric' when run above query. please help.
select sd.sasid, s.siteid db1.site s left join db2.sasdata sd on s.siteid = convert(nvarchar(16), sd.shipid)
try converting shipid nvarchar(16).
Comments
Post a Comment