Are you using temporary tables in function? If yes, there could be a chance that collation of tempdb is different in the server. One method to fix this is to check for places where collation error happens in function and manually set collation of columns of involved using COLLATE <collation setting>ex:suppose when using below querySELECT TableA.col1, TableB.col2FROM TableAINNER JOIN TableBON TableA.col3 = TableB.col3
you get error like:-Msg 468, Level 16, State 9, Line 1Cannot resolve collation conflict between 'Latin1_General_CI_AS' and 'SQL_Latin1_General_CP1_CI_AS' in equal to operationyou can fix this using COLLATE clause as:-SELECT TableA.col1, TableB.col2FROM TableAINNER JOIN TableBON TableA.col3 COLLATE Latin1_General_CI_AS = TableB.col3 COLLATE Latin1_General_CI_AS