title: sql execution plan nested loop
body: <p>trying to remove the nested loop in the execution plan of a query i have (mssql 2005). have the following table:</p>
  
  <p>TxnID bigint
  CustID bigint
  col1  varchar(4)
  col2  varchar(4)
  col3  varchar(4)
  TxnCurrency char(3)
  TxnAmt money
  TxnDate datetime</p>
  
  <pre><code>-- query 1
  SELECT CustID, TxnCurrency, SUM(TxnAmt) AS TxnAmt
  FROM   table
  WHERE  TxnDate &gt;= @date1 and TxnDate &lt; @date2
         and col1 IN ( @list )
         and col2 = @param
  GROUP BY CustID, TxnCurrency
  
  -- query 2
  SELECT TxnCurrency, SUM(TxnAmt) AS TxnAmt
  FROM   table
  WHERE  TxnDate &gt;= @date1 and TxnDate &lt; @date2
         and CustID = @custID
  GROUP BY TxnCurrency
  </code></pre>
  
  <p>TxnID is the Primary Key, have non clustered index on CustID, TxnDate</p>
  
  <p>should i create another index with include columns to resolve the nested loop?</p>