Is there any issues if we create NONCLUSTERED INDEXES in side a Stored procedure?
Attachments: Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.
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.
Create multiple AOAG and listeners on 2 node cluster
Performance question- Flush Cache
SQL SERVER Join (matching rows from tables)
confusion in calculating Avg CPU utilization of a Stored procedure
Suggestion for storage hardware / scalability SQL Server 2012