BULK insert with FIRE_TRIGGERS not execute the trigger

前端 未结 1 687
臣服心动
臣服心动 2021-01-15 02:56

I am using the following code to Bulk insert a CSV file:

    BULK
INSERT CustomSelection
FROM \'c:\\asd\\a1.csv\'
WITH
(
FIRSTROW =2,
FIELDTERMINATOR = \',\'         


        
相关标签:
1条回答
  • 2021-01-15 03:30

    During a bulk-import operation, your trigger will be fired only once because it's considerated as a single statement that affects multiple rows of data.

    Your trigger should be able to handle a set of rows instead a single rows. Maybe this is the reason because your manual insert test is working fine and your bulk import is failing.

    The C section of this MSDN article, show you how to create an insert trigger to Handle Multiple Rows of Data: http://msdn.microsoft.com/en-us/library/ms190752.aspx

    Hope it helps.

    0 讨论(0)
提交回复
热议问题