September 4, 2012 at 7:56 am
Thanks for catching that opc.three! I didn't realize that I copied in the wrong version. That one didn't multiply the variable by -1 so it required that a negative number be set. I have edited the script above with the fix.
September 4, 2012 at 11:56 pm
What version is your sql server instance at?
-----------------------------------------------------------------------------------------------------------
"Ya can't make an omelette without breaking just a few eggs" 😉
September 5, 2012 at 2:05 am
Read, write and modify permissions are available for the user id which is running the job.
more over i have tried with my windows id still is not deleting but manualy i have access to delete the files.
we are using SQL 2005 SP4.
Regards
Durai Nagarajan
September 5, 2012 at 3:57 am
yes xp_delete_file was fixed in SP2 but i have seen issues re appear in SP4. I generally use a VB script to manage file removal of backups and logs
-----------------------------------------------------------------------------------------------------------
"Ya can't make an omelette without breaking just a few eggs" 😉
September 5, 2012 at 11:57 am
If you can provide the command\statement you are running then it would be easier to check what is the issue. xp_delete_file deletes only native SQL backups and for extension value provide "bak" instead of ".bak". It doesn't like the dot in the extension.
February 27, 2015 at 3:40 am
--Had problems with file delete,. which turned out to be the format of the date provided to the routine
--
declare@del_datechar(8)
set@del_date = convert(char(8),getdate()-2,112)
exec master.dbo.xp_delete_file 0,'c:\temp','bak',@del_date,1
Viewing 6 posts - 16 through 20 (of 20 total)
You must be logged in to reply to this topic. Login to reply