I’m trying to compare two different column types (not my doing, part of a data conversion project). One has form guids stored similar to the following:
0CAF3FBC-3C76-420B-B0C4-42867551E3B5
The other has them stored as the following:
{0CAF3FBC-3C76-420B-B0C4-42867551E3B5}
What would be the best way to join both of these tables on this column (unfortunately it’s a primary key for both). So far I’ve tried casting one table as a guid (with no success) and also tried to build a like statement – but have been unsure how to approach this.
Any help would be very greatly appreciated.
Edit:
In case it’s the data, is this syntactically correct?
inner join report_temp.workflow_lease_proposal lp
on wif.form_guid like '%' + lp.form_guid + '%'
SQL Server is quit intelligent when it comes to comparing values having different datatypes.
Following script works as is without any explicit conversion
Result