Hi to all...
I have a unique problem regarding searching records from huge table which contains at-least 45,00,000 to 50,00,000 records.
Desktop application.
Development tools: SQL Server 2005, Framework 2.0
Language: VB.NET
Now the problem is, when I suppose to insert new record in table, there are 1,00,000 numbers of records which have to check for duplication. For the same I have created a function:
Public Function ICheck(ByVal ID As String)
Query = "SELECT ID FROM Table WHERE ID = '" & ID & "'"
Dim c As String = executeScalar(Query)
If c <> Nothing Then
Return (True)
Exit Function
End If
Return (False)
End Function
Function return true or false & according to that record get added in datatable.
This function called in loop for each record, and this is very time consuming.
Is there any way to save the time for checking ID in table.
If any, please let me know...
Thanks in Adv...