what does sp_tablecollations_100 do?

c# sqlbulkcopy sql-server-2008

Question

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,...

Accepted Answer

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.



Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why