Click here to Skip to main content
15,892,927 members
Home / Discussions / Database
   

Database

 
GeneralRe: sql query Pin
Wendelius7-Jan-09 19:41
mentorWendelius7-Jan-09 19:41 
QuestionImport Data From Other Database and Eliminate Duplicates Pin
polishprogrammer5-Jan-09 9:59
polishprogrammer5-Jan-09 9:59 
AnswerRe: Import Data From Other Database and Eliminate Duplicates Pin
Wendelius5-Jan-09 10:25
mentorWendelius5-Jan-09 10:25 
GeneralRe: Import Data From Other Database and Eliminate Duplicates Pin
polishprogrammer5-Jan-09 10:38
polishprogrammer5-Jan-09 10:38 
GeneralRe: Import Data From Other Database and Eliminate Duplicates Pin
Wendelius5-Jan-09 10:58
mentorWendelius5-Jan-09 10:58 
GeneralRe: Import Data From Other Database and Eliminate Duplicates Pin
polishprogrammer7-Jan-09 9:47
polishprogrammer7-Jan-09 9:47 
GeneralRe: Import Data From Other Database and Eliminate Duplicates Pin
Wendelius7-Jan-09 10:00
mentorWendelius7-Jan-09 10:00 
GeneralRe: Import Data From Other Database and Eliminate Duplicates Pin
polishprogrammer8-Jan-09 10:56
polishprogrammer8-Jan-09 10:56 
After some search (and trial and error), I found this statement to work:

INSERT INTO Employees
SELECT e1.* FROM [;DATABASE=C:\Program Files\Northwind.mdb;PWD=none].as e1
LEFT JOIN Employees as e2 ON e1.Field1=e2.Field1 WHERE e2.Field1 IS NULL

The IS NULL comparison selects only those records from the left side of the join that did not already have a match in the right (target) table.

It seems to work well. When I tried to import records through code (DataTable.Merge or some iteration technique), the import process would take many minutes for moderately sized tables (30000 to 70000 records), but using just the SQL it took the application about 6 seconds do the same operation.

The only major change I had to make when implementing this in code was to insert the appropriate variable for the database path and implement a function to get the password, as appropriate, such as Marshal.PtrToStringAuto(logPointer).

Thanks again for your suggestions and I hope this follow up I provided is useful.
GeneralRe: Import Data From Other Database and Eliminate Duplicates Pin
Wendelius8-Jan-09 11:06
mentorWendelius8-Jan-09 11:06 
QuestionSQL Server- Upload CSV file via Bulk Insert with double Quotation Issue? Pin
Tarini Singh5-Jan-09 4:21
Tarini Singh5-Jan-09 4:21 
AnswerRe: SQL Server- Upload CSV file via Bulk Insert with double Quotation Issue? Pin
Wendelius5-Jan-09 9:18
mentorWendelius5-Jan-09 9:18 
QuestionProblem with large database fetching Pin
Member 40015965-Jan-09 2:40
Member 40015965-Jan-09 2:40 
AnswerRe: Problem with large database fetching Pin
Ashfield5-Jan-09 2:54
Ashfield5-Jan-09 2:54 
AnswerRe: Problem with large database fetching Pin
Wendelius5-Jan-09 9:22
mentorWendelius5-Jan-09 9:22 
AnswerRe: Problem with large database fetching Pin
Aman Bhullar6-Jan-09 5:45
Aman Bhullar6-Jan-09 5:45 
GeneralRe: Problem with large database fetching Pin
Member 40015966-Jan-09 20:22
Member 40015966-Jan-09 20:22 
QuestionNeed SQl Query Pin
karthigachawla5-Jan-09 0:48
karthigachawla5-Jan-09 0:48 
AnswerRe: Need SQl Query Pin
SeMartens5-Jan-09 1:09
SeMartens5-Jan-09 1:09 
GeneralRe: Need SQl Query Pin
Ben Fair5-Jan-09 4:13
Ben Fair5-Jan-09 4:13 
GeneralRe: Need SQl Query Pin
SeMartens5-Jan-09 4:26
SeMartens5-Jan-09 4:26 
GeneralRe: Need SQl Query Pin
Ben Fair5-Jan-09 5:51
Ben Fair5-Jan-09 5:51 
QuestionConfused about instance name in SQL cluster Pin
George_George3-Jan-09 23:15
George_George3-Jan-09 23:15 
AnswerRe: Confused about instance name in SQL cluster Pin
Wendelius4-Jan-09 0:49
mentorWendelius4-Jan-09 0:49 
GeneralRe: Confused about instance name in SQL cluster Pin
George_George4-Jan-09 22:23
George_George4-Jan-09 22:23 
GeneralRe: Confused about instance name in SQL cluster Pin
Wendelius5-Jan-09 4:33
mentorWendelius5-Jan-09 4:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.