?
Solved

CONSTRAINT  (IGNORE_DUP_KEY = OFF)

Posted on 2007-04-05
2
Medium Priority
?
2,824 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 200 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

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Suggested Courses

777 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