title: Sql transaction failure
body: <p>I am getting below error while inserting records in database.</p>
  
  <pre><code>System.Transactions.TransactionException: The operation is not valid for the state of the transaction. ---&gt; System.TimeoutException: Transaction Timeout
     --- End of inner exception stack trace ---
     at System.Transactions.TransactionState.EnlistPromotableSinglePhase(InternalTransaction tx, IPromotableSinglePhaseNotification promotableSinglePhaseNotification, Transaction atomicTransaction)
     at System.Transactions.Transaction.EnlistPromotableSinglePhase(IPromotableSinglePhaseNotification promotableSinglePhaseNotification)
     at System.Data.SqlClient.SqlInternalConnection.EnlistNonNull(Transaction tx)
     at System.Data.ProviderBase.DbConnectionInternal.ActivateConnection(Transaction transaction)
     at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
     at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
     at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
     at System.Data.SqlClient.SqlConnection.Open()
  </code></pre>
  
  <p>Actually i am inserting data in database by transaction scope method, code for which is described below.</p>
  
  <pre><code>TransactionOptions tOptions = new TransactionOptions();
  tOptions.IsolationLevel = IsolationLevel.ReadCommitted;
  tOptions.Timeout = TransactionManager.MaximumTimeout;
  using (var transactionScope = new TransactionScope(TransactionScopeOption.RequiresNew, tOptions))
  {
  }
  </code></pre>
  
  <p>Is there anything incorrect in above statement?</p>
  
  <p>One thing to mention here is that i am bulk inserting data in atleast 10 tables with lot of records and tables also allow duplicate records to be inserted in bulk insert, Syntax used to achieve this is mentioned below.</p>
  
  <pre><code>CREATE UNIQUE INDEX Index_a ON table1([c1], [c2]) WITH IGNORE_DUP_KEY
  </code></pre>
  
  <p>Will be thankful if anyone could help me with this issue.</p>