Friday, March 9, 2012

Regular Expressions in SQL Server 2005

Hi-

Someone posted on a thread that you can use VB (or C#) to write Regular Expressions for SQL Server 2005. I know how to write RegEx in VB, so can someone point me to a reference which explains how to use them in / with SQL2005? Or, can someone explain how?

Thanks,

-David

OK. At this point I'm pretty sure that this can be accomplished through the common language runtime. Can someone confirm this?

-David

|||

Yes with CLR intergration in SQL Server 2005, you can write CLR Stored procedures in VB or C#. By referring to System.Text.RegularExpressions namespace you can add regular expression support to your stored procs. Here are couple of links to get you started:

http://msdn2.microsoft.com/en-us/library/ms131094(SQL.90).aspx

http://www.dotnetfun.com/articles/sql/sql2005/SQL2005CLRSProc.aspx

|||

Thanks for the links. I've been using regex in my VBA project, and MS seems to have done a pretty decent job implementing it. I'm a PERL regex expert from long before which of course helps.

Thanks again.

No comments:

Post a Comment