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 «««12345

XP_cmdshell DIR Expand / Collapse
Author
Message
Posted Wednesday, July 13, 2011 7:42 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, October 17, 2014 10:12 AM
Points: 702, Visits: 3,012
Are you allowed to use CLR?

I got fed up with a number of work-arounds I had to get file information, so I created a CLR-based TVF to return several attributes of files in a passed-in directory. This made it easy to get things like the filename both with and without the file extension, the archive bit (which I really needed, so I could run an agent job and look for backup files that didn't go off to tape), etc.

This was one of my first forays into CLR, and the syntax of creating a TVF was a little odd to me, but there were some excellent examples here:
http://nclsqlclrfile.codeplex.com/
and here:
http://www.sqlservercentral.com/articles/SQLCLR/65656/
that I used as go-bys.

Rich
Post #1141000
Posted Tuesday, July 29, 2014 9:27 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, August 25, 2014 11:44 AM
Points: 1, Visits: 14
I am using SQL 2012, wanting to use DirTree to capture folder/subfolders within a share on a server - I can path to the UNC via Windows explorer with no issue - as it uses the local admins auth to that share via that method, however when xp_dirtree runs the credentials it uses are anonymous. can i use SetCred someplace to have windows store the credentials and put the user name in my script?

thanks!
Post #1597360
« Prev Topic | Next Topic »

Add to briefcase «««12345

Permissions Expand / Collapse