You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
1.1 KiB
Markdown

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# SQL Server CLR 集成功能
## 概念
从SQL Server 2005开始SQL Server 引入了 Microsoft Windows 的 .NET Framework 的公共语言运行库 (CLR) 组件的集成。
这意味着您可以使用任意 .NET Framework 语言VB.NET 和 C#)编写存储过程、触发器、用户定义类型、用户定义函数、用户定义聚合函数以及流处理表值函数。
也即是SQL Server中调用c#编译后的DLL中的方法。具有以下优点
+ 更好的编程模型。
+ 改进了安全和安全性。
+ 能够定义数据类型和聚合函数。
+ 通过标准化环境简化了开发。
+ 具备改善性能和可扩展性的潜力
## 注意事项
+ 版本要匹配
```textile
从 SQL Server 2005 开始支持,之前的版本不支持;
每个版本的SQL Server内置的.NET CLR版本不同支持的 .NET Framework版本不同但高版本会兼容底版本
```
+ 安全性设置
+ 限制条件
## 使用步骤
1. 开发C#类库程序并编译成DLL类库文件
2. 启用 CLR 集成
3. 部署 CLR 程序集
4. CLR 集成安全性
5. 调试 CLR 程序集
6. 其它事项