Solved

VB6 update SQL Server

Posted on 2009-05-20
2
207 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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
DTS Connection Failed 7 66
SSRS 2012 r2 - Parm Drop Down has Date/Time 12 30
SQL Server 2012 r2 - Varible Table 3 19
insert wont work in SQL 14 18
Article by: Leon
Software Metering within our group of companies has always been an afterthought until auditing of software and licensing became a pain point. Orchestrator and SCCM metering gave us the answer and it was an exciting process.
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
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…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

813 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