Hi all.
I have one stored procedure which inserts data into 3 tables, (does UPSERTS), and has some rudamentary logic. (IF-THEN-ELSE)
I need to execute this Sproc millions of times (From a C# app) using different parameters and I need it to be FAST.
What is the best way to do so?
Does anybody know an open-source (or not) off the shelf document indexer besides Lucene or Sql Server FTS??
*I am trying to build a document word-index. For each word in the document I insert into the DB the word, docID, and word position.
This happens 100000 times for 100 documents for example.
The Sproc : there are 3 tables to insert into, for each one I do an UPSERT.
The C# app :
using (SqlConnection con = new SqlConnection(_connectionString))
{
con.Open();
SqlTransaction trans = con.BeginTransaction();
SqlCommand command = new SqlCommand("add_word", con, trans);
command.CommandType = System.Data.CommandType.StoredProcedure;
string[] TextArray;
for (int i = 0; i < Document.NumberOfFields; i++)
{
...
Addword(..., command); <---- this updates parameters with new values and ExecuteNonQuery.
}
}
I Forgot to mention , this code produces deadlocks in Sql Server . I have no idea why this happens.