Skip to content

localIColumn.CustomPropertyCollection["JoinToReferenceColumn"].Value is null #13

@fmms

Description

@fmms

Hi Keith,

I mentioned an Exception in #4 i was now able to narrow it down. However I am not sure what a "correct" fix is:

Processing Project package 'STG_TL_xxx'... Error enumerating packages on SQL Server 'x.x.x.x': Cannot perform runtime binding on a null reference
Strack Trace :   at CallSite.Target(Closure , CallSite , Object )
   at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0)
   at CallSite.Target(Closure , CallSite , Object )
   at Microsoft.Samples.DependencyAnalyzer.SSISEnumerator.EnumerateDataFlowComponent(Int32& packageRepositoryID, Package package, TaskHost taskHost, String packageLocation, Int32& dataFlowRepositoryObjectID, Dictionary`2& componentIDToSourceRepositoryObjectMap, Dictionary`2& componentIDToRepositoryObjectMap, IDTSComponentMetaData100 component)
   at Microsoft.Samples.DependencyAnalyzer.SSISEnumerator.InspectDataFlow(IDTSPipeline100 pipeline, Int32 packageRepositoryID, Package package, TaskHost taskHost, String packageLocation)
   at Microsoft.Samples.DependencyAnalyzer.SSISEnumerator.EnumerateTask(Package package, String location, Int32 packageRepositoryID, DtsContainer dtsContainer)
   at Microsoft.Samples.DependencyAnalyzer.SSISEnumerator.EnumerateTask(Package package, String location, Int32 packageRepositoryID, DtsContainer dtsContainer)
   at Microsoft.Samples.DependencyAnalyzer.SSISEnumerator.EnumeratePackage(Package package, String location)
   at Microsoft.Samples.DependencyAnalyzer.SSISEnumerator.EnumerateProjectPackages(ProjectInfo project, DirectoryInfo tempDirectory, String server)
   at Microsoft.Samples.DependencyAnalyzer.SSISEnumerator.EnumerateSqlPackages(String server, String user, String pwd, String[] rootFolders, Boolean storeThreePartNames, String[] storePackagePasswords)

After adding a lot of debugging information, i could find the error in the expression

repository.AddAttribute(componentRepositoryID, localInput.Name + " [" + localIColumn.Name + "] [ID: " + localIColumn.ID.ToString() + "]", "From [" + localIColumn.UpstreamComponentName + "] " + FormatColumnDescription(localIColumn.Name, localIColumn.DataType, localIColumn.Length, localIColumn.Precision, localIColumn.Scale) + " Reference Column [" + localIColumn.CustomPropertyCollection["JoinToReferenceColumn"].Value.ToString() + "]");

https://github.com/keif888/SQLServerMetadata/blob/master/DependencyAnalyzer2008/SsisEnumerator.cs#L1141

The problem is that localIColumn.CustomPropertyCollection["JoinToReferenceColumn"] is null.

Changing this to
localIColumn.CustomPropertyCollection["JoinToReferenceColumn"].Value != null ? localIColumn.CustomPropertyCollection["JoinToReferenceColumn"].Value.ToString() : "null"

Makes the reading of SSIS packages work for me.

Thanks

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions