| Comment | SQLServer Stored Procedure
PURPOSE
List properties of the Disk Partitions on the local computer.
Field list:
- DiskNumber INT NOT NULL (PK)
- PartitionNumber INT NOT NULL (PK)
- AccessPaths VARCHAR(512) NULL
- Size BIGINT NULL
This procedure uses the following method:
- Create Powershell script on Windows temp folder
- Run the Powershell script (with xp_cmdshell) and output results to csv-file to Windows temp folder
- Use BULK INSERT to load the csv-file into a temp table
- Select results from the temp table
EXAMPLES
EXEC [dbo].[prc_ps_diskpartition];
USED OBJECTS
- xp_cmdshell (extended stored procedure) (*)
- powershell (external program)
- dbo.prc_save_text_to_file (SP in local database) (**)
- dbo.fun_FolderExist (UDF in local database) (**)
- dbo.fun_DeleteFile (UDF in local database) (**)
- dbo.fun_FileExist (UDF in local database) (**)
- dbo.fun_TempFolder (UDF in local database) (**)
(*) - Needs config parameter 'xp_cmdshell' = 1
(**) - Needs config parameter 'Ole Automation Procedures' = 1
HISTORY
2026-01-24 - Created procedure
2026-03-07 - Use UDF dbo.fun_TempFolder to get Windows temp folder
TAGS
<program>
<description>List properties of the Disk Partitions on the local computer</description>
<generic>1</generic>
<author>Gerrit Mantel</author>
<created>2026-01-24</created>
<lastmodified>2026-03-07</lastmodified>
</program> |