Thursday, April 14, 2011

Is there a way to rebuild/repair ASP.Net personalization tables without losing the data inside?

I inherited an Asp.Net app that uses ASP.Net membership services. I am trying to add web parts with personalization to the site, and am getting a lot of errors. It looks like the tables generated by Aspnet_regsql.exe have been changed - probably copied at some point in the past using "select into" causing them to lose all their indexes and primary keys.

How can I repair these tables without losing all the data inside?

From stackoverflow
    1. Backup database (just in case!)
    2. Rename existing database
    3. Recreate aspnetdb
    4. Bulk copy data from renamed DB into newly recreated DB. (probably with BCP)

    I know BCP is an old tool... but it still works. Maybe there is an easier way to do it, but this is how I would do it.

0 comments:

Post a Comment