Click here to Skip to main content
15,884,099 members

Comments by Santosh K. Tripathi (Top 152 by date)

Santosh K. Tripathi 31-Mar-16 6:32am View    
i know, it may work with 2014, but i am using 2008 :(
Santosh K. Tripathi 31-Mar-16 6:05am View    
thanks for response. i just copy and paste you code.


DECLARE @tmptable TABLE (
Id int identity(1,1)
,ProductId int
,INDEX IX3 NONCLUSTERED(Id,ProductId)
)

still same error...

1. incorrect syntax near to 'INDEX'.
2. incorrect syntax near to 'ID'. Expecting select, or '('. -(this is after NONCLUSTERED key word).
Santosh K. Tripathi 31-Mar-16 5:59am View    
Note:- due to some reason, i have to use table variable, not temp table.
Santosh K. Tripathi 31-Mar-16 5:43am View    
as you told new code is

Declare @tmptable table (Id int identity(1,1) primary key ,ProductId int)
CREATE NONCLUSTERED INDEX ind1 ON @tmptable (Id, ProductId)

Now in second line
1. incorrect syntax near to '@tmptable'.

Note:- i have to use table variable, not temp table.
Santosh K. Tripathi 31-Mar-16 5:33am View    
thanks for response.

1. incorrect syntax near to 'INDEX'.
2. incorrect syntax near to 'ID'. Expecting select, or '('. -(this is after NONCLUSTERED key word).