Backup of a table

greenspun.com : LUSENET : SQL Server Database Administration : One Thread

How can I take a backup of tables (not of the database)

-- Anonymous, April 24, 2001

Answers

Arun,

A backup allows you to backup a database or a transaction log.

If you want to backup a single table, you can use the bcp (bulk copy) command to write the table contents to a file. You can then use bcp to read the file back in to the table.

Be aware that when you restore the table, since the rest of the data in the database is likely to have changed, there can be all the sorts of problems that you might expect: duplicate keys, foreign key constraint violations, etc.

In contrast, since a database backup is a snapshot of a consistent database at an instant in time and when a database restore takes place the entire database is restored, a database restore will have no such consistency problems.

Hope this helps,

Eric

-- Anonymous, April 24, 2001


Moderation questions? read the FAQ