473,748 Members | 10,737 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Best way to add to DB while checking for duplicates

Situation:
Day 1
Table contains 100 items of actions imported via FTP. One of the fields
in the table can be updated to reflect an assigned unit code.
Day 2
Actions that may be duplicates of the table from Day 1 (with the
exception of the updated assigned unit field) are imported for
inclusion in the Table from Day 1.

Question- What is the best way to insure that any new items are added
to the table and that no duplicates are added at the sametime?

Assistance would be appreciated.

Jul 23 '05 #1
1 1203
A common solution is to load your data into a staging table which has
the same structure as the destination table. You can then use a query
like this to import only new rows:

insert into
dbo.Destination (col1, col2, ...)
select
col1, col2, ...
from
dbo.Staging s
where not exists (
select *
from dbo.Destination d
where s.keycol = d.keycol)

Simon

Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1909
by: Spockie | last post by:
I do not use linkedlist stdlibrary, vector i make my own, but i have problems with one issue, and that is checking if there are duplicates in the middle of inputing information line 294 http://cpp.enisoc.com/pastebin/?3935 i overload cin to get class video tape data, After i enter one data member for VideoTape class, i need it to check if that data is duplicated in the other class linkedlist, i am not sure about how to...
1
2037
by: mike | last post by:
Hello all, any advice or links to pages about how to have multiple language asp pages? For example, you have a database driven website that you want customers around the world to use. How do you setup the asp pages so that it is easy to change the text based on where the user is connecting from? Thanks, Mike
5
1904
by: Jermin | last post by:
Hi, I have a database composed of a single table composed of 2 columns, an auto-numbered ID column and a column which contains 30 million random numbers. All I want to Access to do is check the numbers and let me know if there are any duplicates. Ideally I'd like Access to flag the duplicates if they exist. The easy approach that I thought would work is to go to Design view and select Indexed table, No Duplicates. This doesn't work...
5
2332
by: kevinjouco | last post by:
Hello Have searched the group for a solution to the following problem without success: Table 1 has Ref No (No Duplicates) & Min Max Value Fields ie Ref No 1 Min 1 Max 10 Ref No 2 Min 11 Max 20 etc Table 2 is linked by Ref No (Allows Duplicates) & Recorded Value
7
2341
by: raddrummer | last post by:
I have a main form that has combo boxes linked to a query that outputs the results of the query to text boxes on a subform. We have a job code (naming) convention here that assigns the first 2 digits based on the location selected from the combo box, the next 2 from the department, and so on... I've set up the subform to requery itself any time data from the combo boxes on the main form is changed, and that is working fine. The problem...
2
1672
by: oaklander | last post by:
I currently have two String variables I check to find if they are duplicates: String str1 = "red"; String str2 = "yellow"; if (str1.equals(str2)){ System.out.println("Duplicate"); } else{ System.out.println("Not duplicate");
2
1403
by: lostdawg | last post by:
Hi, I have a question regarding duplicate entries. Basically I have a simple database with a main table called contacts. This table has 2 fields, contactsid and contactsnum. The main form has a combo box select which triggers a subform query to display records that are relevant sorting via the contactsid field. I would like to be able to prevent duplicates being entered in the contactsnum field for each group of contactsid displayed...
5
1557
by: fluk | last post by:
Hi Guys, I hope someone can help me with this, because i'm getting crazy to find a good way to do that! This is what I got by querying a db. $arr1 = array("site", "description", "area1" , "activity1"); $arr2 = array("site", "description", "area1" , "activity2"); $arr3 = array("site", "description", "area2" , "activity2"); $arr4 = array("site1", "description1", "area3" , "activity2");
7
6864
by: john.cole | last post by:
I have searched all the groups I can, and I still haven't been able to come up the solution I need. I have the following problem. In my form named sbfrmSpoolList, I am entering a job, spool and revision number. My table is indexed properly to not allow duplicates, but I would like teh user to be notified that they are typing a duplicate via a message box, then I woulld the update of the record to be cancelled. I have tried the...
0
8830
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9370
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9321
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6796
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6074
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4602
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3312
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2782
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.