blogs.conchango.com

welcome to the conchango blogging site
Welcome to blogs.conchango.com Sign in | Join | Help
in Search

SSIS Junkie

T-SQL: Remove collation statements using Regular Expressions

I use datadude quite alot and recently I imported lots of tables into my datadude project but forget to configure it to not import the collation (more on how to configure that some other time). Hence, I had a huge collection of tables with unwanted collation statements in them.

An easy way to fix this is to use Visual Studio's find/replace functionality. That's OK, but my tables got imported with different collations (don't ask) so a standard find/replace wouldn't work. Thankfully Visual Studio supports regular expressions for finding "stuff". Here's the regular expression that I came up with for finding all my collation statements:

  • COLLATE[ ][a-zA-Z0-9_]*[ ]

Very simple. I'm mainly putting this here for my own benefit because I know I'll need it again someday. If it helps anyone else, so much the better.

 

-Jamie

 

 

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

No Comments

Leave a Comment

(required) 
(optional)
(required) 
Submit

This Blog

Syndication

News

Powered by Community Server (Personal Edition), by Telligent Systems