Domanda

I have a web application that has an SQL database.

For clarity I'm using Asp.Net 4.0/c#/SQL Server 2008 Web edition.

I recently puclished the site, which was my first, by creating a deployment package for the database.

Now a couple of months down the line, I need to update the database structure. The web application now has data that has been entered via the web, so i'll need to update the structure, then copy data across.

As this is the first time I've done it, I'm unsure of the process I should follow - is there a standard practice for this kind of update?

Also, since some of the tables use incremental ID's I need to ensure they remain the same in the newly updated database.

Any tips, links, advice appreciated.

È stato utile?

Soluzione

Important Guidelines:

I assume you have not changed structure entirely (means keys column are same though solution is around for that too)

Steps are as follows:

  1. Take export of the database
  2. Add or remove the columns or whatever changes you want
  3. Import the database back
  4. Check the log for rows/tables (if some) were not updated successfully
  5. Make SQL queries for them and run them to sync

Altri suggerimenti

Here are some general steps for this:

  • Take backup of your online database and restore it locally
  • Modify local database to suite your needs
  • Use third party comparison and synchronization tool to publish changes to your production database

There are many of these available and you can use them in trial mode to get the job done if you’re on a tight budget. You can try tools from Red Gate, ApexSQL, Idera, Dev Art and others…

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top