开发者

SSIS 2008 - how to do regular expression search in SSIS Derived Column tool

How do I do a regular expression in an SSIS Derived Col开发者_StackOverflow社区umn Tool

i.e.

I have string in the format XXXNNNN and I want to filter our those strings not in this format using an SSIS Derived Column Tool.

i.e

ABC1234 is ok

ABCDEFG is not.


The Derived Column transformation doesn't support regular expressions, so you'll have to look at some other options:

  1. Use a Script Task and write the regex using the standard .NET regex features
  2. Use a third-party component
  3. If you always have 7 characters, you could use the SUBSTRING and CODEPOINT functions to check that each one is in the range you expect (see the function reference). But that's probably awkward to read and maintain, and may not be practical at all depending on what your data looks like.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜