Just before a bulkinsert (SqlBulkCopy) I see a
excec sp_tablecollations_100 N'.tb_tablename'
in the profiler
What does this do? Is it a sign of a problem or is it normal?
Thanks for your help
update
the bulik insert afterwards show with the COLLATION in the insert statement. It is working fine, just wondering if this is 'normal behaviour' or that the COLLATE in the bulk insert is somehow affecting performance?
insert bulk tb_dvr_patient ([geboortejaar] VarChar(4) COLLATE Latin1_General_CI_AS,...
Indexing around SQL Bulk InsertRemoving indexes prior to large inserts on a table, including when using SQL Bulk Insert, may be a best practice to increase performance.
The interesting parameters in the SqlBulkCopy class are: Table locking.
Inserting multiple records in a database is the most common and important task in almost all application. There are inbuilt classes in . NET which support bulk insert which helps to insert multiple records in Database.
I was curious myself so I had a look at the SQL code behind the stored proc and it is this:-
ALTER procedure [sys].[sp_tablecollations_100]
(
@object nvarchar(4000)
)
as
select
colid = s_tcv.colid,
name = s_tcv.name,
tds_collation = s_tcv.tds_collation_100,
"collation" = s_tcv.collation_100
from
sys.spt_tablecollations_view s_tcv
where
s_tcv.object_id = object_id(@object, 'local')
order by colid
Seems that it just tells you the collation for the columns on that table.
Does that help?
Rick.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With