Solved

CONSTRAINT  (IGNORE_DUP_KEY = OFF)

Posted on 2007-04-05
2
2,732 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
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…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

747 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now