T-SQL: How do I create a unique key that is case sensitive?

后端 未结 2 1816
傲寒
傲寒 2020-12-05 04:33

How do I create a unique constraint on a varchar field that is case sensitive (SQL Server 2005)?

Currently my constraint looks like this:



        
2条回答
  •  情深已故
    2020-12-05 04:54

    You can only set the case-sensitivity of the data in the database (smallest granularity of column). You can't set case-sensitivity of an index - that would be equivalent to being able to index on an expression, which is possible in some databases but not Sql Server.

提交回复
热议问题