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

Popular posts from this blog

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -

javascript - Restarting Supervisor and effect on FlaskSocketIO -

android - Format a french phone number -