Powershell Script for regular DBA activities_GenerateScripts

  • Comments posted to this topic are about the item Powershell Script for regular DBA activities_GenerateScripts

  • Why do you need to script this table?

  • The table I had mentioned is just for an example.
    It shows the functionalities that you get if you wish to script a table might be for testing on local environment with limited set of data

  • What is I want to script a long list of tables but not all tables?
    It would be helpful if you could allow user to populate a target file with all answers supplied.

    For instance:

    <target
      ServerName="myserver",
      Database="mytestdb",
      SchemaFlag="Y",
      DataFlag="Y",
      IndexFlag="Y",
      ForeignKeyFlag="Y",
      ...>
      <TableList Schemaname="DBO">table1, table2</TableList>
      <TableList Schemaname="Finance">fin_table1, fin_table2</TableList>
      <TableList Schemaname="Sales">sales_table1, sales_table2</TableList>
    </target>

  • RandomStream - Monday, January 8, 2018 10:55 AM

    What is I want to script a long list of tables but not all tables?
    It would be helpful if you could allow user to populate a target file with all answers supplied.

    For instance:

    <target
      ServerName="myserver",
      Database="mytestdb",
      SchemaFlag="Y",
      DataFlag="Y",
      IndexFlag="Y",
      ForeignKeyFlag="Y",
      ...>
      <TableList Schemaname="DBO">table1, table2</TableList>
      <TableList Schemaname="Finance">fin_table1, fin_table2</TableList>
      <TableList Schemaname="Sales">sales_table1, sales_table2</TableList>
    </target>

    Ditto: And what if I wanted to generate scripts of all tables in a database? I see that this does not work on views - only on tables, or am I doing something wrong? 
    With that aside, Great article. It is simple to use and it actually works right out of the box. So many samples I see online don't work and require a bit of tweaking or a complete re-write of the code. But on this site, things just work!
    And that's why I love this web-site. 
    It's my one-stop-shop for all things SQL.

    Aubrey W Love
    aka: PailWriter
    https://www.aubreywlove.com/

Viewing 5 posts - 1 through 4 (of 4 total)

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