none
Export Data from SQL Database created with LS RRS feed

  • Question

  • Hi,

    I think in the future there will be a moment when I have to export my data from my existing database to a new one.

    Today I tried some things. I published and created a new Database. After this I wanted to export the data from the old to the new one.

    For Example I have a table with orders :

    Order_ID, Order_Number, Relation to Costumer

         1                 1                      Costumer 1

    In the SQL Table I have the following Data:

    Order_ID, Order_Number, Relation to Costumer

         1                 1                           1 --> The ID of the Costumer is added in the table

     

    And a table costumer:

    Costumer_ID, Costumer_Name

            1               Costumer 1

            2               Costumer 2

    If I delete the first row of the costumer I have the following:

    Costumer_ID, Costumer_Name

            2               Costumer 2

    If I export now the costumer table to the new Database I have to create an entry with Costumer_ID 1:

    Costumer_ID, Costumer_Name

            1               Costumer 2

    Know I have the problem that Costumer 2 has Costumer_ID 1, so I cannot export Data if I delete an costumer or an order.

    Know I do not really know to do this, because I do not really know SQL and Database Design etc. I use LS because of this, but I think if I want to export my Data in the Future I have to solve this problem.

    Maybe there is a other way to export data? Know I just tried it with the export tool in the Server Management Center.

    Thanks.

    Markus

    Monday, September 5, 2011 11:15 PM

Answers

  • You are correct you will need to play with the identity fields. But that all depends on your import and export problem. Another way to do this is to export the data in an ordered method (I have used XML in the past) then import it back in and let the database structure relink to new id's.
    http://www.virtualrealm.com.au - XNA Game Programming News and Resources from Downunder.
    • Marked as answer by Dragonalw Tuesday, September 6, 2011 9:19 AM
    Tuesday, September 6, 2011 1:35 AM
  • Dragonalw,

    I have been doing that in a smaller degree, as I have one machine i use for building my LS apps and another one where I use the apps.  As I continue to make enhancements, i have found it sometimes more conducive to export and import the data from old db to new db.

    Just build some screens in LS that you can use to export the data to excel methodically.  Then I re-import the exported data back into the new LS App.

    Remember that if you use the appropriate summary items on your tables in LS, then you do not need the IDs specifically as much...

    • Marked as answer by Dragonalw Tuesday, September 6, 2011 9:19 AM
    Tuesday, September 6, 2011 3:14 AM

All replies

  • Hi,

    after trying the whole evening with no result know I have found the thing I have to do.

    In the column mappings in the export wizards I have to check Enable Identity insert.

    After this I have always the right ID's.

    Markus

    Monday, September 5, 2011 11:34 PM
  • You are correct you will need to play with the identity fields. But that all depends on your import and export problem. Another way to do this is to export the data in an ordered method (I have used XML in the past) then import it back in and let the database structure relink to new id's.
    http://www.virtualrealm.com.au - XNA Game Programming News and Resources from Downunder.
    • Marked as answer by Dragonalw Tuesday, September 6, 2011 9:19 AM
    Tuesday, September 6, 2011 1:35 AM
  • Dragonalw,

    I have been doing that in a smaller degree, as I have one machine i use for building my LS apps and another one where I use the apps.  As I continue to make enhancements, i have found it sometimes more conducive to export and import the data from old db to new db.

    Just build some screens in LS that you can use to export the data to excel methodically.  Then I re-import the exported data back into the new LS App.

    Remember that if you use the appropriate summary items on your tables in LS, then you do not need the IDs specifically as much...

    • Marked as answer by Dragonalw Tuesday, September 6, 2011 9:19 AM
    Tuesday, September 6, 2011 3:14 AM