Home Forums Programming Powershell Generate Create Script for a table - include indexes, keys, statistics RE: Generate Create Script for a table - include indexes, keys, statistics

  • Thanks John. I'll have to try that again. I did exactly that in profiler yesterday and the queries it revealed pulled back various info on the table, indexes, etc. but didn't reveal any "create" scripts in the query results. Either I did it wrong, or SSMS scripting handles that "consolidation" part in some internal code.

    SSMS scripting does fairly well but never seems to do anything with statistics. I found a separate query for that, but was hoping to go the powershell route.