How do I create a non-clustered index on the table variable below? I tried but it's throwing an exception
Incorrect syntax near '@TBL'
My code:
DECLARE @TBL TABLE(ID INT PRIMARY KEY, FROMDATE DATETIME, TODATE DATETIME)
CREATE NONCLUSTERED INDEX IX_myindex
ON @TBL (FROMDATE);
Thanks