Partial backup of database

0

I need to create a partial backup of a SQL Server database (only some tables); for example if the table has referential integrity I must restore the tables that make up that integrity (parent tables, and daughters tables), I hope someone can give me a suggestion for days, I'm dead. Thanks

    
asked by Arturo Cruz 03.08.2017 в 01:01
source

1 answer

1

You can put those tables within the same Filegroup and make backup about the latter. You can not backup on a particular transaction.

To create the filgroup in a database, execute the following script:

Use master
go
alter database MyDB add filegroup [NewFileGroupName]
go

You create a new table with this FileGroup

create table MiTabla (Columna1 int, Columna2 date) on NewFileGroupName

Then to execute the backup:

backup database MyDB Filegroup = N'NewFileGroupName' to disk = N'Ruta\archivo.bak' with notformat, noinit, name = N'Filegroupbackup', skip, norewind, nounload,  stats = 10

It is important that the database in question is in recovery mode Full

    
answered by 03.08.2017 в 18:15