Walter Kelt
Walter Kelt

Reputation: 2279

MSSQL DB Multi-Table Export to Excel Issue

I need to export a subset of db data tables into a single file. I tried using SSMS to export to an excel workbook. Each table would have its own worksheet. Sounds ideal !! However, many of our table names are > 31 characters in length, thus table names are being truncated by excel (which apparently has a nonconfigurable worksheet naming convention) as the worksheets are created. This won't work for us, and its far too late to change the table names. Therefore, seems excel workbook is out.

I am thinking there must be an existing tool that has a wizard that would allow us to select a handful of tables and store it in hierarchical way, in a single file, such that the table names are properly preserved in the file. Perhaps an export to json ??

Any suggestions ??

Upvotes: -1

Views: 81

Answers (1)

Walter Kelt
Walter Kelt

Reputation: 2279

Could not find a product, or open source tool, that would properly save Azure SQL Tables whose table name length could be > 31 characters. Wrote a python script and saved tables in json format (snippet).

      {
       "artifacts": [{"tablename": "[dbo][Config_Entity_Metadata_Sample_Table]",
                      "contents": "{\"schema\"{\"fields[{\"name\":\"index\",\"type\":\"integer\"},}]
      }    

Upvotes: 0

Related Questions