Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Append new records

Status
Not open for further replies.

Eddyoftheyear

Technical User
Aug 11, 2010
57
US
I am trying to run a query to append records to an existing table. The table has 3000 records and need to append 5000 to it. When I run append query, it erases the existing record and append the new 5000 only.

How to append so I have a total of 8000
 
INSERT INTO FY2010Details08242010 ( [month], [Fiscal year/period], [Cost Center], [Fund name], Amount, [Project Name], [GC Line Name], [CO Doc Line Item Txt], [CO Header Text], Vendor, [Created by], [Document type], [Document type name], [CO Document Number], [Partner Cost Center], [Partner Cost Center name], [Partner Order], [Partner Order name], [Partner Order name], [CO Doc Line Item], [Created On], Accounts, Years )
SELECT FY2009Details08242010.month, FY2009Details08242010.[Fiscal year/period], FY2009Details08242010.[Cost Center], FY2009Details08242010.[Fund name], FY2009Details08242010.Amount, FY2009Details08242010.[Project Name], FY2009Details08242010.[GC Line Name], FY2009Details08242010.[CO Doc Line Item Txt], FY2009Details08242010.[CO Header Text], FY2009Details08242010.Vendor, FY2009Details08242010.[Created by], FY2009Details08242010.[Document type], FY2009Details08242010.[Document type name], FY2009Details08242010.[CO Document Number], FY2009Details08242010.[Partner Cost Center], FY2009Details08242010.[Partner Cost Center name], FY2009Details08242010.[Partner Order], FY2009Details08242010.[Partner Order name], FY2009Details08242010.[Partner Order name], FY2009Details08242010.[CO Doc Line Item], FY2009Details08242010.[Created On], FY2009Details08242010.Accounts, FY2009Details08242010.Years
FROM FY2009Details08242010;
 
Your query would not delete anything. Therefore, my theory is that you are actually only appending 2000 records and you are assuming that because the total is only 5000 that it deleted the original 3000. The 3000 not getting appended may be because they break constraint rules or are invalid in some other way.

How are you running the query (through code, straight through the query window, etc)? Do you get a message of how many records were inserted?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top