Thursday, March 22, 2012

backing up a single table

Hello:
Could someone please share with me the exact syntax to use within Query
Analyzer for backing up a single table, rather than a whole database?
Thanks!
childofthe1980sThere isn't a T-SQL syntax for backing up a single table. May I ask why?
"childofthe1980s" wrote:
> Hello:
> Could someone please share with me the exact syntax to use within Query
> Analyzer for backing up a single table, rather than a whole database?
> Thanks!
> childofthe1980s|||childofthe1980s wrote:
> Hello:
> Could someone please share with me the exact syntax to use within
> Query Analyzer for backing up a single table, rather than a whole
> database?
> Thanks!
> childofthe1980s
You can't backup a table, but you can backup a file or file group. See
"Using File Backups" in BOL for more information.
The other option is to schedule a DTS export on the table on a periodic
basis if you're more concerned with just the data in the table.
--
David G.|||Hi,
If you need to backup this table frequently then,
1. Create a new file group
2. Put this table inside the new file group
3. Backup the file group. See file group backup in books online (see Backup
Database command)
If you need to backup this table only once then:-
1. Create a new database
2. From query analyzer run the below command
select * into newdb..tablename from sourcedb..tablename
3. Backup the new database.
Thanks
Hari
SQL Server MVP
"childofthe1980s" wrote:
> Hello:
> Could someone please share with me the exact syntax to use within Query
> Analyzer for backing up a single table, rather than a whole database?
> Thanks!
> childofthe1980s|||Thanks, Hari! That last section about backing up the table once worked
perfectly!!!
"Hari Prasad" wrote:
> Hi,
> If you need to backup this table frequently then,
> 1. Create a new file group
> 2. Put this table inside the new file group
> 3. Backup the file group. See file group backup in books online (see Backup
> Database command)
> If you need to backup this table only once then:-
> 1. Create a new database
> 2. From query analyzer run the below command
> select * into newdb..tablename from sourcedb..tablename
> 3. Backup the new database.
> Thanks
> Hari
> SQL Server MVP
>
> "childofthe1980s" wrote:
> > Hello:
> >
> > Could someone please share with me the exact syntax to use within Query
> > Analyzer for backing up a single table, rather than a whole database?
> >
> > Thanks!
> >
> > childofthe1980s

No comments:

Post a Comment