Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SQL backup table and delte

Author  Topic 

h2sut
Starting Member

40 Posts

Posted - 2007-12-20 : 23:32:28
this stored proc (sp) should first backup the table if it doesn't exist and then delete all but the most recent 3

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-12-20 : 23:36:39
That sounds very good. But where is the stored procedure ?


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-12-20 : 23:52:05
Read Tara's blog. She has a backup SP that does that.


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

h2sut
Starting Member

40 Posts

Posted - 2007-12-21 : 10:12:57
Were at in Tara blog does she have a sp that does that.

quote:
Originally posted by khtan

Read Tara's blog. She has a backup SP that does that.


KH
[spoiler]Time is always against us[/spoiler]



Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-12-21 : 10:24:32
I can't remember. Why don't you scan through the blogs.


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-12-21 : 13:29:51
Is it what maintenance plan do?
Go to Top of Page

Sundaresan
Starting Member

28 Posts

Posted - 2007-12-26 : 06:11:32
How to back up a single table in sql server 2000. I went thro Tara's Blog but i couldnt find one. please help.

Thanks,
Sundar

Sundaresan.R
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-12-26 : 07:25:07
quote:
Originally posted by Sundaresan

How to back up a single table in sql server 2000. I went thro Tara's Blog but i couldnt find one. please help.

Thanks,
Sundar

Sundaresan.R


Script out the table object and bcp data to text file

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-12-26 : 07:25:11
You can only backup an entire database not single table.

However, you can
1. use BCP to export the data out to file
2. copy the records to another table
select * into backup_table from original table



KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-12-26 : 22:07:41
If the table is in its own file group, you can just backup that file group.
Go to Top of Page
   

- Advertisement -