Thursday, February 16, 2012

backup/copy just a table

How can I perform a backup of a single table so that I
can then restore the table to another server with a new
table name?
Hi,
Backup a single table is not avalable directly from SQL 7, but it was there
in SQL 6.5. But you can perform a filegroup backup.
What you could do is you can put the tables which need frequent backup into
a seperate file group. After that you
can very well restore the file group backup.
Thanks
Hari
MCDBA
"Gio" wrote:

> How can I perform a backup of a single table so that I
> can then restore the table to another server with a new
> table name?
>
|||Just be aware that the backup cannot be used alone, it has to be restored into the database from
where the backup was performed.
Also, the backup cannot be used to "go back in time" for that part of the database. All transaction
log backups taken since need to be applied until the database is usable.
Typically, when I see a request for table backup, filegroup backup is *not* the answer... :-)
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Hari Prasad" <HariPrasad@.discussions.microsoft.com> wrote in message
news:9FC2795D-79A0-4339-9D80-5BE68C80D675@.microsoft.com...[vbcol=seagreen]
> Hi,
> Backup a single table is not avalable directly from SQL 7, but it was there
> in SQL 6.5. But you can perform a filegroup backup.
> What you could do is you can put the tables which need frequent backup into
> a seperate file group. After that you
> can very well restore the file group backup.
> Thanks
> Hari
> MCDBA
>
> "Gio" wrote:
|||"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:u9TnxigoEHA.1088@.TK2MSFTNGP09.phx.gbl...
> Just be aware that the backup cannot be used alone, it has to be restored
into the database from
> where the backup was performed.
> Also, the backup cannot be used to "go back in time" for that part of the
database. All transaction
> log backups taken since need to be applied until the database is usable.
> Typically, when I see a request for table backup, filegroup backup is
*not* the answer... :-)
Funny enough, I was just looking at this issue today and came to the same
conclusion. ;-)
While it has its place, for waht I need, it's just not going to work. Which
is unfortunate.

> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
|||Greg,
*Maybe* the PARTIAL option of the RESTORE command can be useful for you. You restore into a new
database, but using PARTICAL, you don't have to restore the whole database, only PRIMARY and the one
containing the data you want. Then just copy that data over to your production database...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Greg D. Moore (Strider)" <mooregr_deleteth1s@.greenms.com> wrote in message
news:cE45d.83103$Kt5.23453@.twister.nyroc.rr.com...
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
> message news:u9TnxigoEHA.1088@.TK2MSFTNGP09.phx.gbl...
> into the database from
> database. All transaction
> *not* the answer... :-)
> Funny enough, I was just looking at this issue today and came to the same
> conclusion. ;-)
> While it has its place, for waht I need, it's just not going to work. Which
> is unfortunate.
>
>
|||"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:%23RSexuuoEHA.1712@.tk2msftngp13.phx.gbl...
> Greg,
> *Maybe* the PARTIAL option of the RESTORE command can be useful for you.
You restore into a new
> database, but using PARTICAL, you don't have to restore the whole
database, only PRIMARY and the one
> containing the data you want. Then just copy that data over to your
production database...
As you said "maybe". :-)
There are other areas I may end up using filegroup backups, but this won't
be one of them.
But thanks for remindnig me of the PARTIAL command.

> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>

No comments:

Post a Comment