SQL SERVER CLR的优势 [英] Advantage of SQL SERVER CLR

查看:112
本文介绍了SQL SERVER CLR的优势的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

与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的优势的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆