create index clause on table variable
<p>I need to create an Index on two columns (within a table variable) which do not form unique key. </p>

<p>Table structure is shown below - </p>

<pre><code>DECLARE @Sample TABLE (                           
    [AssetSk] [int] NOT NULL,                
    [DateSk] [int] NOT NULL,             
    [Count] [numeric](38, 2) NULL         
    )  
</code></pre>

<p>I am trying to add Index as shown below -           </p>

<pre><code>INDEX AD1 CLUSTERED([AssetSk],[DateSk])  
</code></pre>

<p>However it gives me the following error while running it on SQL Server 2012<br>
" Incorrect syntax near 'INDEX'. If this is intended as a part of a table hint, A WITH keyword and parenthesis are now required. See SQL Server Books Online for proper syntax."</p>

<p>However, this runs perfectly on SQL Server 2014 . Is there any way that I could run it on SQL Server 2012 . </p>