Unique constraint that only considers alphanumeric characters on SQL Server

夙愿已清 提交于 2020-01-16 09:04:12

问题


Is it possible to create an unique constraint on a table column, which ignores any non-alphanumeric characters? Especially spaces, dashes and slashes? The constraint should, for example, trigger, if the table already contains a string "test" and the user create a new dataset with the text "te-st" or "t e s t" or even "t - es/t". The table only allows lowercase letters.

来源:https://stackoverflow.com/questions/57710047/unique-constraint-that-only-considers-alphanumeric-characters-on-sql-server

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