Solved

CONSTRAINT  (IGNORE_DUP_KEY = OFF)

Posted on 2007-04-05
2
2,755 Views
Last Modified: 2008-02-01
Hi,

I have a script to create a table in which there is a CONSTRAINT, can somebody explain what this CONSTRAINT would achive.

CONSTRAINT [PK_CategoryCategoryHistory] PRIMARY KEY CLUSTERED
(
      [ParentCategoryID] ASC,
      [ChildCategoryID] ASC,
      [SiteLangID] ASC,
      [ParentVersion] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

And also is there a site that would list all the key words used in sql server and explain the usage?
Thanks

0
Comment
Question by:SA4
2 Comments
 
LVL 10

Expert Comment

by:lahousden
ID: 18861676
As for the site: www.microsoft.com (look for SQL Server).  But, to be brutally frank,  if you want the experts on this site to do all your work for you you will need to part with more than 50 points a pop...
0
 
LVL 39

Accepted Solution

by:
appari earned 50 total points
ID: 18862202
from BOL

IGNORE_DUP_KEY = { ON | OFF }
Specifies the error response to duplicate key values in a multiple-row insert operation on a unique clustered or unique nonclustered index. The default is OFF.

ON
A warning message is issued and only the rows violating the unique index fail.

OFF
An error message is issued and the entire INSERT transaction is rolled back.

The IGNORE_DUP_KEY setting applies only to insert operations that occur after the index is created or rebuilt. The setting has no affect during the index operation.

IGNORE_DUP_KEY cannot be set to ON for XML indexes and indexes created on a view.

In backward compatible syntax, WITH IGNORE_DUP_KEY is equivalent to WITH IGNORE_DUP_KEY = ON.
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question