NoviceToDotNet
NoviceToDotNet

Reputation: 10815

how to find index of a row in sql server?

How can i fetch column names from a table on index basis, like I want to make a tables whose column name should be the name of last column fields of a result set of a query, but those result sets last columns value may be different at different execution time, so i want to know how can i fetch those index value of that last column to make a temp table with column name of those last columns value of a result set. Is there any way/function in sql server to dynamically form that?

Upvotes: 1

Views: 2308

Answers (2)

Mitch Wheat
Mitch Wheat

Reputation: 300728

sp_helpindex:

Reports information about the indexes on a table or view.

Upvotes: 1

Related Questions