Exporting Simple Data Structure With a Nested Type

Exporting Simple Data Structure With a Nested Type

Comments

  • Hello,

    Im having trouble exporting some data that Ive created with a simple data structure. The structure has a nested type, and when I use the Export Data to CSV action, the CSV doesnt include the data in the nested type making the export invalid. Is there any way I can export the simple data structure data along with its associated nest type data?

  • [color=rgb(34, 34, 34)][font=Arial, Helvetica, sans-serif]Hello,[/font][/color]
    [color=rgb(34, 34, 34)][font=Arial, Helvetica, sans-serif]
    [/font][/color]
    [color=rgb(34, 34, 34)][font=Arial, Helvetica, sans-serif]The import/export CSV step is only capable of exporting data on flat data structures (ie. data structures without nested composite datatypes) outright. However, Ive found a good workaround for this issue using a SQL File to transfer the import/export the data for the parent structure and its nested structure, and have included instructions below.[/font][/color]
    [color=rgb(34, 34, 34)][font=Arial, Helvetica, sans-serif]
    [/font][/color]
    [color=rgb(34, 34, 34)][font=Arial, Helvetica, sans-serif]- Export the parent data structure and its nested type(s) to the target environment.[/font][/color]
    [color=rgb(34, 34, 34)][font=Arial, Helvetica, sans-serif]- Then in SQL Management Studio, locate the database that we intend to export from in the databases folder, and Right Click->Task->Generate Scripts[/font][/color]
    [color=rgb(34, 34, 34)][font=Arial, Helvetica, sans-serif]- Click Next[/font][/color]
    [color=rgb(34, 34, 34)][font=Arial, Helvetica, sans-serif]- Choose the Select specific database objects option and select the tables for your parent data structure and nested type(s), then click next[/font][/color]
    [color=rgb(34, 34, 34)][font=Arial, Helvetica, sans-serif] + Ive included a screenshot of where to find the table names below [/font][/color]
    [color=rgb(34, 34, 34)][font=Arial, Helvetica, sans-serif]- Click advanced, scroll down to Types of data to script and change the value from Schema only to Data only, then click okay.[/font][/color]
    [color=rgb(34, 34, 34)][font=Arial, Helvetica, sans-serif]- Under File Name you can select the location that the SQL file to be saved to.[/font][/color]
    [color=rgb(34, 34, 34)][font=Arial, Helvetica, sans-serif]- Click next, then next again and it should begin creating your SQL File.[/font][/color]
    [color=rgb(34, 34, 34)][font=Arial, Helvetica, sans-serif]- Open the SQL File on the server holding the database we intend to import to.[/font][/color]
    [color=rgb(34, 34, 34)][font=Arial, Helvetica, sans-serif]- Once the Query opens and displays in SQL Management Studio, on the first line ensure that the text displayed by USE is the name of your target database[/font][/color]
    [color=rgb(34, 34, 34)][font=Arial, Helvetica, sans-serif]- Execute the query (F5)[/font][/color]
    [color=rgb(34, 34, 34)][font=Arial, Helvetica, sans-serif]- The Database records should now be updated and retrievable in the decisions environment[/font][/color]

  • Wouldnt your solution only work on a nested DB Structure and you would just open the query editor and do "Select * FROM ..." for all the separate structures you had nested or otherwise? This wouldnt work for a serialized flow structure, for example, correct?

  • Austin,

    I may have misinterpreted your question, but this method should work effectively for any DB stored data structures as a method of transferring their contents to a copy of the same table in a separate DB. As flow structures are not DB stored and their data typically only exist at runtime, this method would not work for flow structures

Sign In or Register to comment.