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.
Object | Enforced? |
---|---|
Default | Yes |
Unique index/unique constraints | Yes |
Primary key and foreign key constraints | Yes |
Check constraint | No[*] |
Rule | No |
Trigger | No |
[*] 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.