Sunday, February 19, 2012

Error: The component has inconsistent metadata

I have a Source Query with this sql set as a property expression:

"SELECT Category, Server_Name, Entitle_UserID,User_SubID,Start_Time,End_Time,Entitle_User_Name,Stat_Name,Stat_Count,Stat_Type,pk,create_date,run_num,Average,Median,Maximim FROM tbl_ws_stats WHERE pk > " + (DT_STR, 100, 1252)@.[pk_var]

There is a message : 'The component has inconsistent metadata.'

Then when I click on the Source Query: 'The component is not in a valid state. Do you want the component to fix itself automatically?'

I also notice that there are no columns on the Column Mappings tab and no way to add columns.

How can I correct?

Thanks

Additional info, also receiving these errors when executing the package:


[DTS.Pipeline] Error: input column "" (94) has lineage ID 12 that was not previously used in the Data Flow task.

[DTS.Pipeline] Error: "component "Destination - tbl_WS_Stats" (60)" failed validation and returned validation status "VS_NEEDSNEWMETADATA".

|||

You could do worse than to (a) back up your package, and (b) let SSIS fix up the metadata automatically ... and see what results.

Donald

|||

I tried responding 'yes' when prompted to automatically fix the metadata. That did not work. Is there anyway to manually fix or another workaround?

|||What were the symptoms of the automatic fix not working? No columns?|||

That's correct. There are no columns. Is there any way for me to fix this?

Thanks

|||What value is PK (Sample values)
What value are you passing pk_var?

WHERE pk > " + (DT_STR, 100, 1252)@.[pk_var]

What happens when you remove your where clause? I suspect it's something with the where but can't tell without more information.

|||

pk is a numeric value
pk_var is a package variable with a value of 1051062000

Tried changing the sql statement to the following without the where clause, to rule out issue with pk_var. I had the same issue as before.


"SELECT Category, Server_Name, Entitle_UserID,User_SubID,Start_Time,
End_Time,Entitle_User_Name,Stat_Name,Stat_Count,Stat_Type,pk,
create_date,run_num,Average,Median,Maximim FROM tbl_ws_stats"

Thanks

|||Compare each column's source datatype with the target datatype. That is the only way you will fix this issue. One of them must be inconsistent.

(P.S. that query is structured very inefficiently and will be slow if you have many rows)

No comments:

Post a Comment