Groups | Blog | Home
all groups > sql server dts > march 2007 >

sql server dts : Inserting to a Partitioned view in SSIS


daniel_barkman
3/29/2007 11:48:04 AM
I have a Partitoned view that UNIONs 65 underlying tables with the same
schema. This was originally implemented in SQL 2000. I upgraded to SQL 2005
Standard Edition and am now trying to write an SSIS package to load data from
text files into these tables.

Since each file would load into only one partition, I would like to
dynamically determine which underlying table to insert. I don't know how to
do this. I would like to take advantage of the metadata the SQL Server
Destination component stores to do BULK copies.

I tried inserting directly into the partitoned view, but SSIS gives me the
error "Views referencing tables on multiple servers are not updatable in the
edition of this SQL Server". The tables all exist on the same server.

Is there
1) a way to dynamically declare the table in a SQL Server Destination
component?
or
2) figure out why SQL Server thinks these tables exist on different servers?

I'd prefer 1, but I'd take 2 or any other advice anyone has for me.

Thank you,
Dan Barkman
DBA
daniel_barkman
3/29/2007 5:02:02 PM
OK, I answered my own question. I believe you have to use the OLE DB
Destination to use a variable for the table name.

I am worried about the performance hit of this, however.

If anyone knows how to use a variable for a table name in the SQL Server
Destination, I'd appreciate it. Also, does anyone know how severe the
performance hit is between using the OLE DB and SQL Server Destinations?

Dan Barkman
DBA
Redwood Trust, Inc.



[quoted text, click to view]
daniel_barkman
4/2/2007 2:06:01 PM
The ETL does sit on the same server being inserted to, and all tables in the
partitioned view are local. Is there anywhere I can look to see why SQL
Server thinks the tables may be on another server? I believe this is the only
way I can use the SQL Server Destination component, since you seem to be
agreeing that I cannot designate a target SQL table at runtime for a SQL
Server Destination.

Is my understanding correct?

[quoted text, click to view]
daniel_barkman
4/2/2007 3:58:04 PM
I tried inserting directly into the partitoned view, but SSIS gives me the
error "Views referencing tables on multiple servers are not updatable in the
edition of this SQL Server".

I take this to mean SQL thinks my tables are on multiple servers. But they
aren't - they're all local - as is my SSIS environment.

Dan

[quoted text, click to view]
Allan Mitchell
4/2/2007 8:05:00 PM
Hello daniel_barkman,


The SQL Server destination is special in that it moves within the SQL Server
memory space and is very very quick. That said the ETL must sit on the same
server as the SQL Server into which you are inserting to do this. As to
how severe the difference will be, well that is one of those "It depends"
questions.

I would test and see.




--

Allan Mitchell
http://wiki.sqlis.com | http://www.sqlis.com | http://www.sqldts.com |
http://www.konesans.com

[quoted text, click to view]

Allan Mitchell
4/2/2007 10:40:16 PM
Hello daniel_barkman,

Why do you think SSIS thinks the tables do not reside locally to the package.
Remember if it is you on your wkstn executing the package then the SQL Server
has to be there as well.

--

Allan Mitchell
http://wiki.sqlis.com | http://www.sqlis.com | http://www.sqldts.com |
http://www.konesans.com

[quoted text, click to view]

Allan Mitchell
4/3/2007 5:44:31 AM
Hello daniel_barkman,

What edition of SQL Server are you running (EE or DE?)?

it looks like something thinks it is a DPV. This wouldn't be an SSIS thing
this is an engine thing as you should get the same problem using other tools

Can you select from the DPV/PV?

--

Allan Mitchell
http://wiki.sqlis.com | http://www.sqlis.com | http://www.sqldts.com |
http://www.konesans.com

[quoted text, click to view]

AddThis Social Bookmark Button