Created
November 1, 2010 06:55
-
-
Save leomao10/657740 to your computer and use it in GitHub Desktop.
Accessing the Windows File System from SQL Server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--Extended Stored Procedure - xp_cmdshell - Ability to execute any DOS command line code. | |
EXEC master.dbo.xp_cmdshell 'dir c:\' | |
GO | |
--Extended Stored Procedure - xp_fixeddrives - Ability to capture the free drive space in megabytes. | |
EXEC master.dbo.xp_fixeddrives | |
GO | |
--Extended Stored Procedure - xp_subdirs - Ability to capture the sub directories, but not files | |
EXEC master.dbo.xp_subdirs 'c:\' | |
GO | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment