Monday, March 19, 2012

How to load data into a table using a synonym?

I'd like to use a data flow task to load data into a table by specifying the synonym name of the destination table, instead of the actual table name.

The OLE DB Destination is forcing me to pick an actual table or view from a drop down list. Any ideas on how to get around this?

Thank you.

This will be fixed in SP1, so that synonyms also appear in the UI in the drop down list. For RTM, the workaround is to use SqlCommand access mode, and then if you specify "select * from synonymTable", that will work.

|||

Using a SELECT statement (which is what Ranjeeta has said) is what you should be doing anyway - don't use the drop-down.

Simon explains why here: http://sqljunkies.com/WebLog/simons/archive/2006/01/20/17865.aspx

-Jamie

|||Jamie,

Is that your recommendation even for OLE DB Destinations? I can

certainly understand why you would recommend this for Sources/Lookups,

but for a destination it seems odd because you lose some options

(fast-load, keep identity, check constraints,etc) when using a SQL

statement.

Also do know or have experienced the "feature" or "bug" that Simon describes as being applicable to the OLE DB Destination?

Thanks,

Larry Pope|||

Larry,

No, I was talking about source adapters only.

-Jamie

No comments:

Post a Comment