Is there any issues if we create NONCLUSTERED INDEXES in side a Stored procedure?
Technically, no, there's no issue - be careful to check for the index existing on the table before you attempt to add it again though.
It's not the normal approach though, as it's a one-time operation, so why have this inside a stored procedure?
@hi kev Riley,
thanks for your replay.
my stored procedure having multiple while loops it is taking more time to execute .so i have created indexes and drop that indexes after the query execution.
the while loops are mandatory to get report correctly shall i use this.
18 People are following this question.