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

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -