PoSh Index Rebuilds

  • Comments posted to this topic are about the item PoSh Index Rebuilds

  • This was removed by the editor as SPAM

  • Nice question

    But just like the 29th December question it's more about the SMO object model than about PoSh. The first option is not the right one because a SMO database object doesn't have an indexes collection as an attribute. The second is not the right one because the tables collection doesn't have an indexes collection as an attribute. The fourth option is eliminated by knowing that "Collection.InstanceName" is not the correct syntax (Collection["IndexName"] ) for referencing the member of a collection indexed by a given name, so one could claim that that's about PoSh syntax but (a) it's a bit of a stretch (just about every language I know that provides both attributes and collections maintains a clear distinction between attribute selection and finding an object in a collection, so this is not really something specific to PoSh) and (b) it only helps eliminate one of the three wrong options.

    edit:typo

    Tom

  • I guessed, as I'm one who doesn't really use PowerShell. These questions make it sound pretty simple. I think I'm going to have to look for a simple way to get the data into the database where it can be used. Thanks for the question.

  • Thanks for this easy question ( SMO is my beloved part of SQL Server and I have written many pieces of code with it ). As PowerShell is often written like C# , the good choice was easy.

    Little remark : I have submitted a question in the SMO forum about indexes some years ( before 2008 ) , I have kept the reply from Jens in the depth of my memory , so I have got 1 point today.

  • TomThomson (1/4/2016)


    Nice question

    But just like the 29th December question it's more about the SMO object model than about PoSh. The first option is not the right one because a SMO database object doesn't have an indexes collection as an attribute. The second is not the right one because the tables collection doesn't have an indexes collection as an attribute. The fourth option is eliminated by knowing that "Collection.InstanceName" is not the correct syntax (Collection["IndexName"] ) for referencing the member of a collection indexed by a given name, so one could claim that that's about PoSh syntax but (a) it's a bit of a stretch (just about every language I know that provides both attributes and collections maintains a clear distinction between attribute selection and finding an object in a collection, so this is not really something specific to PoSh) and (b) it only helps eliminate one of the three wrong options.

    edit:typo

    Thanks for your explanation easy to understand so +1 for Tom

  • Thanks for the question.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Thank you for the question.

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply