与T-SQL相比,SQLServer CLR提供了哪些优势?使用.NET语法比使用T-SQL更容易吗?我知道您可以定义用户类型,但是我不清楚为什么更好。例如,您可以定义一个电子邮件类型,它具有前缀属性和域属性。然后,您可以搜索域或前缀或两者。但是,我看不出与添加几列(分别称为前缀和域)并分别搜索它们有什么不同。也许有人有现实的理由为什么这样做会更好。
What advantages does SQLServer CLR offer over T-SQL? Is using .NET syntax easier than T-SQL? I see that you can define user types, but I'm not quite clear on why that's better. For example, you could define an email type and it would have a prefix property and a domain property. You could then search on domain or prefix or both. However, I don't see how that's any different from adding a couple of columns one called prefix and one called domain and searching on them individually. Maybe someone has real world reasons why this is better.
推荐答案我举一个很好的例子:CLR具有内置的RegEx对象,SQL Server中非常缺乏。现在编写函数来进行基于正则表达式的验证约束/修复是很简单的。
I'll give one good example: CLR has a built in RegEx object, which is sorely lacking in SQL Server. Now it's trivial to write functions to do regex-based validation constraints/repairs.
更多推荐
SQL SERVER CLR的优势
发布评论