lowlydba/dba-multitool

[Request] sp_helpme - Add Included Columns for INDEX on TABLE

mattcargile opened this issue · 1 comments

Is your feature request related to a problem? Please describe.
It is not related to a problem.

Describe the solution you'd like
Within the index_name , index_description, and index_keys table output, I'd like to see an index_includes or the like column. I see from this line that we are using sp_helpindex. I'd assume we would have to implement that output ourselves. With 2017 support only, we could use STRING_AGG to comma delimit the columns. Right now, the procedure does work on 2014 and I'd rather use the XML trick for it.

Thoughts?

Describe alternatives you've considered
My alternative was inspecting the index properties within SQL Server Management Studio.

Additional context
Here is the output data showing the table.
image

Can try to use dbatools , Get-DbaHelpIndex as inspiration.

That seems like a good enhancement, thanks for the suggestion! I won't be able to dig into the approach for a little while, but if in the mean time you want to try a PR feel free to.

I do want to keep backwards compatibility for any "supported" versions still so XML is a good way to go (though it is sad to write in 2023)