September 15, 2009 at 8:29 am
I was recommended towards this forum so you guys are hopefully holding answers to a question I have.
I am using Visual Dataflex in the development for an application. This application has a database that it operates against. The database is file based originally, which makes backups of parts of the database easy. It uses indexes to find posts quickly.
It is limited however and by converting it to an MSSQL database it opens up a lot of new doors and possibilities to harness.
Now, the problem is this, I would still like to have an easy way to save (backup) and load (restore) specific tables from within my application. I would prefer if I could save this like some sort of mirror of the database table instead of a file for instance.
Is there a way to accomplish this, and not only saving the shape and form of the table as well as its data, but I would need to save the surrounding information like indexes and such as well. Keeping the indexes is important for the application to continue to work towards the database.
Now, I am not great with SQL, I am quite a beginner. So if you have a solution I would appreciate it if you dumb it down and possibly even give me examples and/or descriptions of how this can be done.
Thank you for reading.
September 15, 2009 at 9:00 am
Some of the third party backup tools (litespeed from Quest, SQL Backup from Red Gate) will restore an object from a backup.
If you want to do it yourself, let me ask you in which scenarios you need to do this? Often a database has links and integrity between tables. If you restore a single table, you may break that integrity.
There are two ways to do this easily. One is to bcp out a table to a file. That's easy. The second is to copy the table to another table in the same (or different) database. Easy to do.
If you have enterprise edition, database snapshots are a third way, but they are more fragile since they won't survive a database restore.
September 16, 2009 at 3:06 am
Hello Steve!
Thanks for your reply.
The database does indeed have integrity between tables as well as indexes that I wish to maintain.
I don't know which is the best or the proper approach to this problem but in my mind I was theorizing around this possibility;
I have a database A. To be able to have all the integrity and index intact I was thinking that first I would like to have a complete mirror copy of that database and have it named B. Now, as the database A changes with different functions in my application I would like to copy (save) a particular table from A to B. In my mind since the structure should be in place in the mirror saving over a table should be no problem, is that correct? Likewise it makes sense to me if I could load (restore) a particular table from the mirror B to the active database A in case some data is faulty in A or for whatever reason one would like to rollback to a previous version.
Is this possible? Is it even a good solution? And if possible and good, how would I go about creating the mirrored database with all its integrity and create functions that send the tables between the two?
Best regards
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply