SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


DTSX Variable Issue, can't distinquish between "42" and "00"


DTSX Variable Issue, can't distinquish between "42" and "00"

Author
Message
CptCrusty1
CptCrusty1
Right there with Babe
Right there with Babe (746 reputation)Right there with Babe (746 reputation)Right there with Babe (746 reputation)Right there with Babe (746 reputation)Right there with Babe (746 reputation)Right there with Babe (746 reputation)Right there with Babe (746 reputation)Right there with Babe (746 reputation)

Group: General Forum Members
Points: 746 Visits: 387
Correction to the title... Can't distinguish between "42" and "IM"

I have a For Loop that iterates through text files and brings them in. Recently, our vendor started getting tricky with the formats and sometimes they use an old style, sometimes a new style. The data is imported into an Evaluation table and we skim off the top row (Select top 1 State.....). That result is passed to an expression. The connectors use a Precedence Constraint (Expression and Constraint, Success, @[User::IndexFormatFlag] != "00") to determine which connection manager to use. If the result is "42" it uses the old format, if it is "00" it's the new format (since "42" != "00")

Recently we started receiving a 3rd format. The structure is completely different; however, I can successfully import it into the eval table and strip of the top. Since the new format has a header row, It gets picked up in the query (Select Top 1 State) has the value "Im". I created a new Precedence Constraint to evaluate it and it works. The constraints for the 3 versions are as follows:

@[User::IndexFormatFlag] == "42" (Old)
@[User::IndexFormatFlag] == "00" (New)
@[User::IndexFormatFlag] == "Im" (Newest)


The problem now is that when the folder with the text files has the newest ("Im") and the oldest ("42"), the precedent constraint seems to be getting confused with the 42 vs. the IM and it tries to load the Old format into the Newest format and then subsequently dies. The data is getting streamed to both at once in fact.

Any ideas as to why this might be happening? I'm thinking about creating a second constraint just for the newest format. That way it has to meet both conditions to continue.
CptCrusty1
CptCrusty1
Right there with Babe
Right there with Babe (746 reputation)Right there with Babe (746 reputation)Right there with Babe (746 reputation)Right there with Babe (746 reputation)Right there with Babe (746 reputation)Right there with Babe (746 reputation)Right there with Babe (746 reputation)Right there with Babe (746 reputation)

Group: General Forum Members
Points: 746 Visits: 387
Anyone? Bueller?
Alexander Suprun
Alexander Suprun
Ten Centuries
Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)

Group: General Forum Members
Points: 1317 Visits: 1516
CptCrusty1 (6/6/2013)
The problem now is that when the folder with the text files has the newest ("Im") and the oldest ("42")
How existence of different files in a folder can impact anything? Do you load all the files into a staging table and then decide what provider to use?

Any ideas as to why this might be happening?
You have a bug for sure. Best tool in this case is a debugger.


Alex Suprun
CptCrusty1
CptCrusty1
Right there with Babe
Right there with Babe (746 reputation)Right there with Babe (746 reputation)Right there with Babe (746 reputation)Right there with Babe (746 reputation)Right there with Babe (746 reputation)Right there with Babe (746 reputation)Right there with Babe (746 reputation)Right there with Babe (746 reputation)

Group: General Forum Members
Points: 746 Visits: 387
Alexander Suprun (6/7/2013)
How existence of different files in a folder can impact anything?

It doesn't. That isn't the problem.


Do you load all the files into a staging table and then decide what provider to use?

Yes, I stated earlier that it's loaded to an Evaluation table to determine which staging table to send it to.

You have a bug for sure. Best tool in this case is a debugger.

It's not a bug, its an missunderstanding of how the logic is being evaluated. I solved the issue a different way, but I haven't figured out why it's doing it in the first place....

Thanks
Crusty
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search