Drop Table

Support Forum for database administrators and web based access to important newsgroups related to databases
Register on Database Support Forum Edit your profileCalendarFind other Database Support forum membersFrequently Asked QuestionsSearch this forum -> 
For Database admins: Free Database-related Magazines Now Free shipping to Texas


Post New Thread










Thread
Author

looking for script to backup Transaction log and delete any thing older than 24 hours
looking for script to backup Transaction log and delete any thing older than
24 hours



Report this thread to moderator Post Follow-up to this message
Old Post
Omran Abdurrahman
10-31-06 05:15 AM


Re: looking for script to backup Transaction log and delete any thing older than 24 hours
Often, the quality of the responses received is related to our ability to
'bounce' ideas off of each other. In the future, to make it easier for us to
give you ideas, and to prevent folks from wasting time on already answered
questions, please:

Don't post to multiple newsgroups. Choose the one that best fits your
question and post there. Only post to another newsgroup if you get no answer
in a day or two (or if you accidentally posted to the wrong newsgroup -and
you indicate that you've already posted elsewhere).

If you really think that a question belongs into more than one newsgroup,
then use your newsreader's capability of multi-posting, i.e., posting one
occurrence of a message into several newsgroups at once. If you multi-post
appropriately, answers 'should' appear in all the newsgroups. Folks
responding in different newsgroups will see responses from each other, even
if the responses were posted in a different newsgroup.




Posted to .tools

--
Arnie Rowland, Ph.D.
Westwood Consulting, Inc

Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous

You can't help someone get up a hill without getting a little closer to the
top yourself.
- H. Norman Schwarzkopf


"Omran Abdurrahman" <omranab@comcast.net> wrote in message
news:ux9eBD9%23GHA.2408@TK2MSFTNGP05.phx.gbl...
> looking for script to backup Transaction log and delete any thing older
> than 24 hours
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
Arnie Rowland
10-31-06 05:15 AM


Re: looking for script to backup Transaction log and delete any thing older than 24 hours
Omran,
If you are using SQL 2005, look at the new XP_Delete_File stored
procedure. Otherwise, Tracy is on the right track. You can store your
backups in a table and run cmd queries with xp_cmdshell to delete files
older than your threshold. This does not need to be a persisted table.
You can also use the dir command to populate a temp table, and delete
based off that.

Delete bak files over 46 hours old
Declare @deletedate nvarchar(255). @Path nvarchar(200)
set @Path =  '\\fileserver\db_bac
kup'
set @deletedate = cast(dateadd(hh,-46,getdate()) as varchar(255))
EXECUTE master.dbo.xp_delete_file  0,@Path,N'bak',@dele
tedate

Personally I would disregard the comments from Arnie Rowland. It is too
bad he does not offer constructive comments.

Terry

Tracy McKibben  wrote:
> Omran Abdurrahman wrote: 
>
> Start here:
> http://realsqlguy.com/serendipity/a...-Send-In-Backup!.html
>
>
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com


Report this thread to moderator Post Follow-up to this message
Old Post
Terry
10-31-06 05:15 AM


Sponsored Links





Last Thread Next Thread
Post New Thread

MS SQL Server archive

Show a Printable Version Email This Page to Someone! Receive updates to this thread
Microsoft SQL Server
Access database support
PostgreSQL Replication
SQL Server ODBC
FoxPro Support
PostgreSQL pgAdmin
SQL Server Clustering
MySQL ODBC
Web Applications with dBASE
SQL Server CE
MySQL++
Sybase Database Support
MS SQL Full Text Search
PostgreSQL Administration
SQL Anywhere support
DB2 UDB Database
Paradox Database Support
Filemaker Database
Berkley DB
SQL 2000/2000i database
ASE Database
Forum Jump:
All times are GMT. The time now is 08:26 PM.

 
Mobile devices forum | Database support forum archive




Copyrights DropTable.com Database Support Forum 2004 - 2006