Sql-server – check what the allocation unit size is on the drives via a query

sql server

Assuming that I do not have access to windows server, can I run a script from SSMS that would allow me to check whether allocation unit size is formatted with 64K?

Best Answer

Maybe this is one way:

EXEC master..xp_cmdshell 'fsutil fsinfo ntfsinfo "C:"';

Line 9 shows, e.g.:

Bytes Per Cluster :               4096

There are obviously more powerful ways to do this using, e.g. PowerShell, but as I suggested in my comment, it's hard to understand exactly what you're going to do with the output in SSMS, and what kind of effort you're willing to go to in order to use these methods from within SSMS... I'd say it's much better to get these values externally (which gives you so many more options), then update a table you can query from within SSMS.