KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a Competitions results table which holds team member's names and their ranking on one hand. On the other hand I need to maintain a table of unique competitors names : CREATE TABLE Competitors (cName nvarchar(64) primary key) Now I have some 200,000 results in the 1st table and when the competitors table is empty I can perform this: INSERT INTO Competitors SELECT DISTINCT Name FROM CompResults And the query only takes some 5 seconds to insert about 11,000 names. So far this is not a critical application so I can consider truncate the Competitors table once a month, when I receive the new competition results with some 10,000 rows. But what is the best practice when new results are added, with new AND existing competitors? I don't want to truncate existing competitors table I need to perform INSERT statement for new competitors only and do nothing if they exists.
Tags (comma-separated)
Save Edits
Cancel