计算机与现代化 ›› 2010, Vol. 1 ›› Issue (10): 186-188.doi: 10.3969/j.issn.1006-2475.2010.10.051

• 应用与开发 • 上一篇    下一篇

利用CLR实现SQL Server 2005复杂字符串格式的验证

常 捷   

  1. 江苏联合职业技术学院连云港财经分院信息工程系,江苏 连云港 222003
  • 收稿日期:2010-06-17 修回日期:1900-01-01 出版日期:2010-10-21 发布日期:2010-10-21

Complex String Validation Through Use of CLR in SQL Server 2005

CHANG Jie   

  1. Information Engineering Department, Lianyungang Branch of Finance and Economics, Jiangsu Union Technical Institute, Lianyungang 222003, China
  • Received:2010-06-17 Revised:1900-01-01 Online:2010-10-21 Published:2010-10-21

摘要: 在SQL Server 2005中通过检查约束来实现一些复杂字符串的验证是比较困难的,由于在SQL Server 2005中集成了CLR,可以利用C#的正则表达式来解决这一问题,本文对CLR在SQL Server 2005中的应用做出了基本的阐述,详细给出了如何使用SQL CLR集成来验证电子邮箱格式的关键步骤和代码,并通过实例进行了验证。

关键词: CLR, SQL Sever 2005, 正则表达式, 触发器

Abstract: Complex string validation in SQL Server 2005 is very difficult by check constraint. For SQL Server 2005 integrates CLR, so using the regular expression of C# is able to solve the problem. The paper describes the application of CLR in the SQL Server 2005 basically. The important step and code for SQL CLR to validate email is also given in detail.

Key words: CLR, SQL Server 2005, regular expression, trigger

中图分类号: