SQL Server Central is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
Search:  
 
 

sp_GetDirInfo

By Clinton Herring, 2005/11/25

Total article views: 198 | Views in the last 30 days: 5

Returns information about the files in the specified directory and/or subdirectories (if requested) and the total bytes for those files. Directory names are excluded so that the total bytes can be computed using the compute clause but you can specify that they be included at the expense of no total bytes. This sp uses the bcp utility and tries to figure out the correct path when SQL 7.0 and SQL 2000 are both installed, however, you can include a bcp path parameter for non-standard installations. Microsoft changed the output format results of "dir /a /X /-C /TC " from Windows 2000 to Windows 2003. This updates the code to reflect the changes so the code will work on either platform.

By Clinton Herring, 2005/11/25

Total article views: 198 | Views in the last 30 days: 5
Your response
 
 
Related tags
 
Already registered?  

Free registration required

To read the rest of this article, and access thousands of other articles, we ask you to register on the site and subscribe to our newsletters.

Register

E-mail address:
Password:
Password (confirm):

  

Subscriptions

We ask you to register on the site and subscribe to our newsletters. Subscribing to our newsletters gets you:

  • ALL of our content (thousands of articles, scripts, and forum postings)
  • A daily newsletter (example)
  • A weekly news round up (example)
  • The opportunity to ask and answer questions in our forums
  • A daily Question of the Day to test and help you increase your knowledge of SQL Server.

We ask that you give the newsletter a try for a week. Over 200,000 SQL Server Professionals a day find it entertaining and useful. If not, you are welcome to unsubscribe at anytime.

Steve Jones
Editor, SQLServerCentral.com