The collation of fields in OpenRowSet can be altered by using the COLLATE clause when specifying the field name in the query. For example:
SELECT [field1] COLLATE Latin1GeneralCIAS, [field2] COLLATE CyrillicGeneralCIAS FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0', 'Excel 12.0;Database=C:\Data.xlsx;IMEX=1', 'SELECT * FROM [Sheet1$]')
In this example, the collation of field1 is changed to Latin1GeneralCIAS and the collation of field2 is changed to CyrillicGeneralCIAS. This allows for proper sorting and comparison of text data in different languages and character sets.
Asked: 2023-05-13 15:00:48 +0000
Seen: 11 times
Last updated: May 13 '23