I'm trying to modify an existing SP to add another table from a different database from another SQL Server.
Original procedure runs without error but when I change this:
to:
I get:
Implicit conversion from data type sql_variant to varchar is not allowed. Use the CONVERT function to run this query.
I've tried this variation:
But I get exactly the same error - can anyone help me with this please?
Original procedure runs without error but when I change this:
Code:
from FS_COHeader ch (readuncommitted)
left join @tbl tbl on ch.COHeaderKey = tbl.COHeaderKey
Code:
from FS_COHeader ch (readuncommitted)
left join @tbl tbl on ch.COHeaderKey = tbl.COHeaderKey
left join ZULU.UK_Main_ED.Company co (readuncommitted) on ch.CustomerID = co.Account_Code
Implicit conversion from data type sql_variant to varchar is not allowed. Use the CONVERT function to run this query.
I've tried this variation:
Code:
left join ZULU.UK_Main_ED.Company co (readuncommitted) on convert(varchar(13), ch.CustomerID) = convert(varchar(13), co.Account_Code)