BCP and Enforcement of Triggers, Rules, Defaults, Constraints, and Unique Indexes

When using BCP to import data into a SQL Server table, it is important that you understand how triggers, rules, defaults, constraints, and unique indexes are enforced. Many people forget that certain types of objects are bypassed when using BCP to import data. Table 14.8 summarizes which objects are enforced when BCP is used to import data.

Table 14.8. Enforcement of Objects
ObjectEnforced?
DefaultYes
Unique index/unique constraintsYes
Primary key and foreign key constraintsYes
Check constraintNo[*]
RuleNo
TriggerNo

[*] By default, constraints are not enforced. However, in SQL Server 2000, you can enable constraint checking by using the CHECK_CONSTRAINTS hint.

CAUTION

Get Microsoft® SQL Server™ 2000 DBA Survival Guide, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.