SSIS and the Metadata Out of Sync Error

Worked late tonight on a problem we’ve been having with our SSIS (SQL Server Integration Services) package. It would run, but give us a weird error about the metadata being out of sync.

It turned out to be a self inflicted error. In the SQL that drove this particular package, the statement ended with …table1.field3, nvl(table2.field4, ‘Missing’) from table1…. Turns out SSIS didn’t like the nvl part. (nvl by the way is an Oracle statement that equates to if field4 is null, return ‘Missing’, otherwise return field4.) Oh, it understood the nvl command OK, but it didn’t like the fact we failed to alias the command in the SQL.

When I updated the SQL to read nvl(table2.field4, ‘Missing’) as field4 from…, AND I did a build on the package, SSIS was happy. Note though that it kept reporting the problem until I did another build on the package, it drove me nuts for a bit until I thought to rebuild the thing.

To sum it up, never leave just an expression in your SQL, always alias it or you too could fall victim to the mysterious Metadata out of Sync Error.

About these ads

2 Responses to “SSIS and the Metadata Out of Sync Error”

  1. Ben Says:

    So when are going to spead a full weekend with your family and leave the computers turned off?

    You know who is leaving this.

  2. Ben Says:

    That is spend not spead.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 93 other followers

%d bloggers like this: