Entity Framework Code First - Change Table Column Collation

Deadly 提交于 2019-12-17 20:17:00

问题


I'm using Entity Framework CTP5 and Code First. I need to change the Collation for a specific column in SQL Server. I believe the default collation is SQL_Latin1_General_CP1_CI_AS, but I need to change this one column colllation to SQL_Latin1_General_CP1_CS_AS (Case Sensitive).

Is there a way to use ModelBuilder in Code First to change a specific column collation?

BarDev


回答1:


Model builder doesn't allow this but you can create custom database initializer and execute ALTER TABLE command. The example will be the same as this one creating custom index.



来源:https://stackoverflow.com/questions/5285781/entity-framework-code-first-change-table-column-collation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!