Return to Snippet

Revision: 8288
at September 11, 2008 10:58 by DaveChild


Initial Code
IF EXISTS (SELECT * FROM INFORMATION_SCHEMA.tables WHERE table_name = 'FreeSpace') DROP TABLE FreeSpace

CREATE TABLE FreeSpace ( SpaceInMB varchar(100) NULL )

INSERT INTO FreeSpace EXEC master..xp_CMDShell 'C:\Scripts\FreeSpace.bat'

Initial URL

                                

Initial Description
This will run a bat file to get free space on a drive and write the results to a table.

Use script at http://snipplr.com/view/8331/calculate-free-space-on-drive/ as FreeSpace.bat

Initial Title
SQL Write Disk Space to Table

Initial Tags

                                

Initial Language
SQL