Section 19.5. Logical (Table-Level) Backups


19.5. Logical (Table-Level) Backups

One alternative to SQL Server backups is to dump the data into text format to be later inserted into some other database, a spreadsheet, or even back into SQL Server. This is accomplished with the bulk copy utility, bcp. The major benefit of this tool is that it doesn't require any knowledge of Transact-SQL, though Transact-SQL can be used to refine the data output. This utility is available for all versions of SQL Server.

The following example dumps all the data in the Items table in the Inventory database to a file called Items.dat.

bcp inventory..Items out Items.dat T c

A similar operation can be performed to insert the data into a table. In this example, simply insert the data back into the table it originated from.

bcp inventory..Items in Items.dat T -c




Backup & Recovery
Backup & Recovery: Inexpensive Backup Solutions for Open Systems
ISBN: 0596102461
EAN: 2147483647
Year: 2006
Pages: 237

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net