Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

SQL Server 2005 Maintenance Mayhem Expand / Collapse
Author
Message
Posted Wednesday, April 04, 2007 7:02 PM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, April 10, 2014 2:24 PM
Points: 172, Visits: 527
Comments posted here are about the content posted at http://www.sqlservercentral.com/columnists/rpearl/2953.asp


Post #356121
Posted Wednesday, April 18, 2007 2:17 AM
Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Friday, September 06, 2013 2:16 AM
Points: 693, Visits: 124
The script posted in this article should come with a big warning: "The xp_delete_file procedure is undocumented and therefore unsupported!".

Here is what a MS employee (Terrence Nevins, SQL Server Program Manager) has to say about it: "The stored procedure was never intended to be called by an end user and the chances that you could ever be successful in having it do what you intend are almost zero. I took a quick peek at the implementation we are using and it takes some very specialzed arguments for a very specific task. [...] We don't document this XP or promote its usage by anyone for very good reasons. Most of all, they can 'go away' from release to release."

Source:
https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=255121

Razvan



Post #359160
Posted Wednesday, April 18, 2007 7:37 AM
SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Tuesday, April 01, 2014 8:03 PM
Points: 6,266, Visits: 2,027
Note that it didn't work while trying to delete files "across the network". but that does not means that it will never work.





* Noel
Post #359236
Posted Wednesday, April 18, 2007 7:45 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, January 10, 2014 8:06 AM
Points: 165, Visits: 117

I found that while the delete older than function in the wizard did not work, I could create a maintenance plan and then just add a maintenance cleanup task to the job. I can specify which directory to delete from, what type of files to delete, and how many days should remain.

This has worked well for me.




Regards,

Carla Hepker
Documentation: A Shaft of light into a coded world.


Post #359240
Posted Wednesday, April 18, 2007 8:58 AM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, April 10, 2014 2:24 PM
Points: 172, Visits: 527

Hi, All:

Thank you for your comments and reading my article.  It was meant to provide some interim solution to the maintenance issue. 

The xp_delete_file is I believe used in the maintenance clean-up task, but didn't work for multiple db's for multiple locations (ie subfolders).  So, this was an extension of that task.

Granted, a disclaimer should have been included in the article (maybe it's not too late - Steve?) as with all scripts, one must be aware there are risks.

As for not working over the network, my backups are only to a network share and works quite well.

Feel free to post any questions, or comments, or email me @ rsp05@pearlknows.com

Regards,

Robert Pearl

 

 




Post #359272
Posted Tuesday, July 17, 2007 8:51 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, March 31, 2014 10:44 AM
Points: 2, Visits: 295

Robert,

Thanks a lot for sharing the code.  It works for me after I replacing the following assignment statement in the code:

from: set @mpath='Backup File Path' + @dir + '\' + @dbname

to: set @mpath=@dir + '\' + @dbname

I really appreciate your sharing to help me to resolve the same issue I encounter.

Thanks again.

Michele

 

Post #382431
Posted Thursday, September 22, 2011 4:53 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, September 25, 2013 8:38 AM
Points: 4, Visits: 156

Hi, I was trying to use xp_delete_file in one of my stored procedure. I was tryign to pass all the parameters like folderPath, FileType and Date to delete the files from specific folder. If I put FileType and Date as parameter with xp_delete_file, its works like

EXECUTE master.dbo.xp_delete_file 0,N'C:\Test\',@fileType,@cutoffDate,0

But if I try

EXECUTE master.dbo.xp_delete_file 0,@folderPath,@fileType,@cutoffDate,0

I get the error Msg 22049, Level 15, State 0, Line 0
Error executing extended stored procedure: Invalid Parameter

Any help will be appriciated
Post #1179291
Posted Friday, September 23, 2011 5:05 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, September 25, 2013 8:38 AM
Points: 4, Visits: 156
I figured out what the problem was.
I was declaring the variable having the datatype NVARCHAR, where they should be declared as VARCHAR

Thanks
Post #1179953
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse