Discussion:
Pattern Matching SSIS Variables
(too old to reply)
Ulysses
2009-04-09 15:27:02 UTC
Permalink
Is * the only pattern matching character that can be used in the value
definition of SSIS variables. Can other pattern matching characters such as
(# or [] or [!] or [^], etc.) be used? Where can a list of these chacters
and examples of their usage be found?
Todd C
2009-04-10 12:29:01 UTC
Permalink
Hello Ulysses:

Not sure I understand your intent. A variable in SSIS (just like any other
programming language) usually contains one and only one value at a time. But
that value changes as the program progresses through the logic.

So just exactly what type of 'pattern matching' are you trying to accomplish
against a variable? Are trying to see if the value at a certain time in your
logic contains a certain string of characters?

Help me understand.
=====
Todd C
Post by Ulysses
Is * the only pattern matching character that can be used in the value
definition of SSIS variables. Can other pattern matching characters such as
(# or [] or [!] or [^], etc.) be used? Where can a list of these chacters
and examples of their usage be found?
Ulysses
2009-04-10 17:14:01 UTC
Permalink
With the * in the value of the SSIS variable it is used, just like a % in SQL
Server. I am looking for files in a folder and the variable called file name
is set to find any file that is like abcd*.txt. I simply want to know what
other pattern matching characters can be used in addition to the * so I can
fine tune the search criteria.
Post by Todd C
Not sure I understand your intent. A variable in SSIS (just like any other
programming language) usually contains one and only one value at a time. But
that value changes as the program progresses through the logic.
So just exactly what type of 'pattern matching' are you trying to accomplish
against a variable? Are trying to see if the value at a certain time in your
logic contains a certain string of characters?
Help me understand.
=====
Todd C
Post by Ulysses
Is * the only pattern matching character that can be used in the value
definition of SSIS variables. Can other pattern matching characters such as
(# or [] or [!] or [^], etc.) be used? Where can a list of these chacters
and examples of their usage be found?
Todd C
2009-04-10 18:27:03 UTC
Permalink
So now I have to ask: If you are using SSIS 2005 (or 2008), why not use the
For Each loop, and let it to loop over all the files in a folder. You can
specify an input mask for the types of file, like *.xls, and wether or not to
look in sub folders.

Then use the Variable mapping tab to assign the Filename (or name and
extension, or full path and filename) to a variable.

Armed with the name of a particular file, you can then do stuff with it
inside the loop.

So what would you be trying to do with all "abcd*.txt" files once you
identified them?

=====
Todd C
Post by Ulysses
With the * in the value of the SSIS variable it is used, just like a % in SQL
Server. I am looking for files in a folder and the variable called file name
is set to find any file that is like abcd*.txt. I simply want to know what
other pattern matching characters can be used in addition to the * so I can
fine tune the search criteria.
Post by Todd C
Not sure I understand your intent. A variable in SSIS (just like any other
programming language) usually contains one and only one value at a time. But
that value changes as the program progresses through the logic.
So just exactly what type of 'pattern matching' are you trying to accomplish
against a variable? Are trying to see if the value at a certain time in your
logic contains a certain string of characters?
Help me understand.
=====
Todd C
Post by Ulysses
Is * the only pattern matching character that can be used in the value
definition of SSIS variables. Can other pattern matching characters such as
(# or [] or [!] or [^], etc.) be used? Where can a list of these chacters
and examples of their usage be found?
Ulysses
2009-04-11 03:54:01 UTC
Permalink
I am using the For Each Loop and the process you discuss. Thanks. Now can
you answer my direct question with a direct answer. Can other pattern
matching characters other than *, such as (# or [] or [!] or [^], etc.) be
used when defining the value of a SQL 2005 SSIS variable?
Post by Todd C
So now I have to ask: If you are using SSIS 2005 (or 2008), why not use the
For Each loop, and let it to loop over all the files in a folder. You can
specify an input mask for the types of file, like *.xls, and wether or not to
look in sub folders.
Then use the Variable mapping tab to assign the Filename (or name and
extension, or full path and filename) to a variable.
Armed with the name of a particular file, you can then do stuff with it
inside the loop.
So what would you be trying to do with all "abcd*.txt" files once you
identified them?
=====
Todd C
Post by Ulysses
With the * in the value of the SSIS variable it is used, just like a % in SQL
Server. I am looking for files in a folder and the variable called file name
is set to find any file that is like abcd*.txt. I simply want to know what
other pattern matching characters can be used in addition to the * so I can
fine tune the search criteria.
Post by Todd C
Not sure I understand your intent. A variable in SSIS (just like any other
programming language) usually contains one and only one value at a time. But
that value changes as the program progresses through the logic.
So just exactly what type of 'pattern matching' are you trying to accomplish
against a variable? Are trying to see if the value at a certain time in your
logic contains a certain string of characters?
Help me understand.
=====
Todd C
Post by Ulysses
Is * the only pattern matching character that can be used in the value
definition of SSIS variables. Can other pattern matching characters such as
(# or [] or [!] or [^], etc.) be used? Where can a list of these chacters
and examples of their usage be found?
Todd C
2009-04-13 14:04:09 UTC
Permalink
I have never needed any pattern other than a * , but I suppose it should work.
Sorry, wish I had a better answer for you.

=====
Todd C
Post by Ulysses
I am using the For Each Loop and the process you discuss. Thanks. Now can
you answer my direct question with a direct answer. Can other pattern
matching characters other than *, such as (# or [] or [!] or [^], etc.) be
used when defining the value of a SQL 2005 SSIS variable?
Ulysses
2009-04-13 19:53:28 UTC
Permalink
I have not found any other pattern matching character(s) to work in the value
definition of an SSIS variable other than *. I have tested each of the
characters I have asked about and none of them work. I appreciate your
attempt to help but you are guessing and I wanted a definitive answer to this
question.
Post by Todd C
I have never needed any pattern other than a * , but I suppose it should work.
Sorry, wish I had a better answer for you.
=====
Todd C
Post by Ulysses
I am using the For Each Loop and the process you discuss. Thanks. Now can
you answer my direct question with a direct answer. Can other pattern
matching characters other than *, such as (# or [] or [!] or [^], etc.) be
used when defining the value of a SQL 2005 SSIS variable?
Loading...