Showing posts with label form. Show all posts
Showing posts with label form. Show all posts

Tuesday, March 27, 2012

duplicate reference key values

HI, I keep getting this warning with a lookup (full cache mode) that retreives data form a table that contains the following information:

SRCE_SYS TABLE_NAME FIELD_NAME CODE ENGLISH_DESCRIPTION
STATIC STATIC PM_PC_TX_TYPE_CODE G GROSS
STATIC STATIC PM_PC_TX_TYPE_CODE E EXCESS
STATIC STATIC PM_PC_TX_TYPE_CODE F FACULTATIVE
STATIC STATIC PM_PC_TX_TYPE_CODE S SURPLUS
STATIC STATIC PM_PC_TX_RIDER_CODE BOAT BOAT
STATIC STATIC PM_PC_TX_RIDER_CODE RIDER RIDER
STATIC STATIC PM_PC_TX_RIDER_CODE CONT CONTENTS

The column tab matches SRCR_SYS, TABLE_NAME and FIELD_NAME (using constants defined in a derived column transform) .The code column comes from the source. We want to retreive the english_description colum from SRCR_SYS, TABLE_NAME,FIELD_NAME and CODE in the dataflow.

I would normally ignore the warning but sometimes, it seems that the lookup does not match any values and enabling memory restriction on the advanced tab resolve the issue and suppress the warning.

As I said, I keep getting this warning and I don't know why since there are no duplicates in the table? Am I missing something?

Thank you,

Christian

For the three fields SRCR_SYS, TABLE_NAME, and FIELD_NAME, there are duplicate keys.

You aren't matching on CODE as well?|||

Yes, I match the code as well so the combination of all 4 columns is unique. Does SSIS looks for all columns that are matched in the column tab or just the first one?

Thanks,

Christian

|||It matches on all columns that you select as lookup columns.

The following query should identify any duplicates:
select srce_sys,table_name,field_name,code,count(*) from table group by srce_sys,table_name,field_name,code having count(*)>1

Wednesday, February 15, 2012

DTS to execute vb code within a database?

i have a piece of code in an adp that is currently behind a form but i could put it in a module and make it public if i need to. how can I use DTS to run this piece of code? which connection and task could i use. can this even be done? i have little experiance with DTS.

thanks.

justinWhat does the code do? What parameters does it take? I can see a couple of answers to this question depending on circumstances:

1. If the code in your ADP is something akin to a "batch" process that your users execute by clicking on a button, then you should be able to put this code straight into a SQL scheduled job (you really don't need DTS since one of the job types in SQL is ActiveX script. If you have parameters in the form that your users supply at runtime, you will need to have an alternate method for calculating these parameters.

2. If the code is doing stuff with data that is local to the users ADP environment, it may/will be a lot trickier. I would need more information if this were the case.

Note that in either case if the ADP code (should be what, VBA?) uses ActiveX objects that are unique to the user environment, you will need to register those objects on the SQL Server.

Regards,

hmscott