?
Solved

VB6 update SQL Server

Posted on 2009-05-20
2
Medium Priority
?
213 Views
Last Modified: 2012-05-07
Processing an update statement is causing a Duplicate Key error inserting.... ?  Primary key error.  The primary key isn't a column being updated??
Update subscriptions set PRODUCT_CODE = 'ONLINE_LIB' , 
BT_ID = '100521' , 
PROD_TYPE = 'SUB' , 
STATUS = 'A' , 
BEGIN_DATE = '10/1/2008' , PAID_THRU = '9/30/2009' , COPIES = 1 , SOURCE_CODE = '' , FIRST_SUBSCRIBED = '12/31/1899' , CONTINUOUS_SINCE = '10/1/2008' , PRIOR_YEARS = 0 , FUTURE_COPIES = 0 , FUTURE_COPIES_DATE = '12/31/1899' , PREF_MAIL = 0 , PREF_BILL = 0 , RENEW_MONTHS = '0' , MAIL_CODE = '' , PREVIOUS_BALANCE = 0 , BILL_DATE = '10/2/2008' , REMINDER_DATE = '12/31/1899' , REMINDER_COUNT = '0' , BILL_BEGIN = '10/1/2008' , BILL_THRU = '9/30/2009' , BILL_AMOUNT = 300 , BILL_COPIES = 1 , PAYMENT_AMOUNT = 300 , PAYMENT_DATE = '10/2/2008' , PAID_BEGIN = '12/31/1899' , LAST_PAID_THRU = '9/30/2009' , COPIES_PAID = 1 , ADJUSTMENT_AMOUNT = 0 , LTD_PAYMENTS = 300 , ISSUES_PRINTED = '' , BALANCE = 0 , CANCEL_REASON = '' , YEARS_ACTIVE_STRING = '' , LAST_ISSUE = '' , LAST_ISSUE_DATE = '12/31/1899' , DATE_ADDED = '10/2/2008' , LAST_UPDATED = '10/3/2008 11:09:50 AM' , UPDATED_BY = 'KTRINH' , INTENT_TO_EDIT = '' , F
LAG = '' , BILL_TYPE = 'A' , COMPLIMENTARY = 0 , FUTURE_CREDITS = 0 , INVOICE_REFERENCE_NUM = 0 , INVOICE_LINE_NUM = 0 , CAMPAIGN_CODE = '' , APPEAL_CODE = '' , ORG_CODE = 'MCLE' , IS_FR_ITEM = 0 , FAIR_MARKET_VALUE = 0 Where  id = '100521'

Open in new window

0
Comment
Question by:Jeff_Kingston
[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 93

Accepted Solution

by:
Patrick Matthews earned 1000 total points
ID: 24432007
Hello Jeff_Kingston,

Are you updating a column that has a unique index, for which your update would introduce a duplicate value?

Regards,

Patrick
0
 

Author Comment

by:Jeff_Kingston
ID: 24432114
You ever been in the forest where you can't see the trees.  there was a field in the updatestring that was a primary key,that I completely forgot about.  Wouldn't it be nice if there error trapping contined the offending row???
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
Viewers will learn how the fundamental information of how to create a table.

752 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