You are here: Preventing the message 'Duplicate key was ignored' « MsSQL Server « IT news, forums, messages
Preventing the message 'Duplicate key was ignored'

Posted by Colin Spalding on 01/10/06 19:08

My problem is that the 'INSERT INTO' query that sends the records to the
table is dynamically compiled in VBA and and the target table has a two
column primary key. I have made a number of attempts at getting 'WHERE
NOT EXISTS' to cure the problem but so far without success and previous
postings have resulted in advice to create an 'ignore duplicates' index.
This solved the problem in as
much as it allowed the SQL to insert the records that did not already
exist but resulted in the message appearing every time the user ran the
the query. Whilst this is not a major problem it is vaguely irritating
and I would like to find a way to stop it happening. I suspect that the
solution may involve using the @@ERROR command but I am not sure of the
syntax.


Regards
Colin

*** Sent via Developersdex http://www.developersdex.com ***

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация