Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what does sp_tablecollations_100 do?

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,...
like image 242
Pleun Avatar asked Mar 14 '11 14:03

Pleun


People also ask

How can I speed up bulk insert in SQL Server?

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.

Does SqlBulkCopy lock table?

The interesting parameters in the SqlBulkCopy class are: Table locking.

What is bulk insert in C#?

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.


1 Answers

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.

like image 138
Richard Adnams Avatar answered Sep 20 '22 13:09

Richard Adnams