title: How to find index exists on multiple columns
body: <p>I have delta script SQL query where in I have to check if a specific index is there or not, if not then create one.</p>
  
  <p>e.g.
  Table structure:</p>
  
  <pre>
  tableA
  Col1 int
  Col2 varchar
  Col3 varchar
  Col4 DateTime
  </pre>
  
  <p>And query is: </p>
  
  <pre><code>IF EXISTS (SELECT 1  
              FROM sys.indexes AS i  
              INNER JOIN sys.index_columns AS ic   
              ON i.object_id = ic.object_id 
                       AND i.index_id = ic.index_id  
                       WHERE i.object_id =OBJECT_ID('dbo.tableA') 
                       AND COL_NAME(ic.object_id,ic.column_id) = 'Col2' ) 
  BEGIN
      PRINT 'Index Exists!'
  END
  ELSE
  BEGIN
                PRINT 'Nonclustered does not Exists!'
                IF NOT EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_tableA_Col2_Col3') 
                BEGIN
                PRINT 'Creating index on tableA'
                CREATE NONCLUSTERED INDEX [IX_tableA_Col2_Col3] ON [dbo].[tableA]
                (
                    [Col2] ASC,
                    [Col3] ASC
                )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
                END
  END
  </code></pre>
  
  <p>There query is able to check if there is index on <code>Col2</code> or not but here what I want to achieve is check if there is an index created on <code>Col2</code> and <code>Col3</code> if not then create.</p>
  
  <p>How can I do that?</p>