Solved

VB6 update SQL Server

Posted on 2009-05-20
2
203 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
2 Comments
 
LVL 92

Accepted Solution

by:
Patrick Matthews earned 250 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

The System Center Operations Manager 2012, known as SCOM, is a part of the Microsoft system center product that provides the user with infrastructure monitoring and application performance monitoring. SCOM monitors:   Windows or UNIX/LinuxNetwo…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

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

12 Experts available now in Live!

Get 1:1 Help Now