cancel
Showing results for 
Search instead for 
Did you mean: 

SQLAnywhere - report available drive space.

0 Kudos

Does anyone know about a function, procedure or other working SQL code snippet which would return the amount of free disk space available on the current drive? (I do not care about the DB or Log sizes, I need to know how much space is left of the host system.)

I found a procedure in Adaptive SE but that does not seem to work on SQLAny. I also tried to access Windows .dll library objects which in theory should work but in reality I am running into (I assume) permission issues and the desired values are not being returned.

Example:

CREATE FUNCTION diskInfo()  RETURNS varchar(100)  EXTERNAL NAME 'Unix:GetDiskFreeSpaceA@Kernel32.lib;GetDiskFreeSpaceA@Kernel32.dll';

select diskInfo();

Any help appreciated.

View Entire Topic

Ahhh... found it 🙂

CALL sa_disk_free_space( );
former_member182948
Active Participant
0 Kudos

There is more function.

SELECT * FROM sp_disk_info( );