Forum Moderators: open

Message Too Old, No Replies

RegEx in SQL 2008 for Dummies

I know this can be done, but I'm not a C# programmer and have no idea how

         

digitalv

12:07 am on Oct 18, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



So I've found all of these articles telling me basically the same thing - open Visual Studio (which I don't have), paste in some code that creates a DLL, then run the CREATE ASSEMBLY Command, then create your functions that use regex.

I'm an old school DBA that has been hacking my way through it since SQL Version 6, 7, 2000, 2005, and now 2008... there are a lot of new things in 2008, this being one of them, that I would love to be able to take advantage of but I know nothing about .net or C# so I'm finding myself somewhat limited to the old ways of tricky replace commands & like operators.

Can anyone tell me what I have to do, in simple English, to run RegEx search/replace functions against varchar fields in SQL 2008?

damon_cool

11:23 pm on Nov 5, 2009 (gmt 0)

10+ Year Member



First google and find a regex tester page. It will take text data and perform a regex expression on the text. Then provide the result.

Then find some sample data from your field. Paste the varchar text into the test text. Next write a regex. Test, change, and repeat until successful.

Lots of helpful articles on regex to get you started on the syntax.

Good luck!