i'm using sql2k.
can i do a bulk isnert operation to a table with a primary key
(identity field) on it? i suspect the dts pacakge didn't utilize the
bulk insert because pk is automatically a non-clustering index, and
bulk insert can only work on table w/o any index. in this case, what
should i do to make sure the fastest load possible?
thank you.> bulk insert can only work on table w/o any index.
Since when? I have several applications where BULK INSERT affects a table
with a clustered index on a datetime column and a non-clustered index on a
foreign key column. The only way it differs from your scenario is that all
the data is in the file (there is no surrogate column generated by the
system).
> in this case, what
> should i do to make sure the fastest load possible?
As long as the generation of the IDENTITY values does not need to correspond
directly 1:1 with the physical order of the file, you may wish to bulk
insert into a heap, and then insert real_table(column_list) select * from
heap.
A|||It is not true that bulk insert will only work with non-indexed tables.
In fact, you can achieve better throughput, if you have a clustered index on
the table, and input file is also sorted in the same order as the clustered
index.
--
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"=== Steve L ===" <steve.lin@.powells.com> wrote in message
news:1123518093.288607.254270@.g14g2000cwa.googlegroups.com...
> i'm using sql2k.
> can i do a bulk isnert operation to a table with a primary key
> (identity field) on it? i suspect the dts pacakge didn't utilize the
> bulk insert because pk is automatically a non-clustering index, and
> bulk insert can only work on table w/o any index. in this case, what
> should i do to make sure the fastest load possible?
> thank you.
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment