I am interested if there is a possibility to specify collation for a column when creating index that is different from the collation of that column?
And when indexed, are string data sorted according to collation of column or collation of database?
I am interested if there is a possibility to specify collation for a column
Share
I don’t believe you can. Although COLLATE is documented separately, you’ll note that there are only 3 places listed where it can occur:
Note that, for instance, in CREATE TABLE:
that the COLLATE clause is explicitly mentioned.
Whereas, in CREATE INDEX:
note that all that is allowed here is a column – not a column definition, nor an expression.
I believe the collation of each column within an index follows the collation of the underlying column(s) in the appropriate table. The database collation isn’t used for much, so far as I’m aware, other than to supply a default collation to columns during CREATE/ALTER table statements.