views:

73

answers:

2

Before inserting filestream data I'd like to check the following NTFS settings:

1) 8.3 naming status (this is disabled by using fsutil behavior set disable8dot3 1)

2) last access status (this is disabled by using fsutil behavior set disablelastaccess 1)

3) cluster size (this is set with format F: /FS:NTFS /V:MyFILESTREAMContainer /A:64K)

The filestream recomendation is to disable (1) and (2) and to set (3) at 64kb.

But before setting this I'd like to know the existing settings. How do I check this? Answer can be in Delphi but not necessarly.

+1  A: 

You can read the registry for points 1 and 2 (using xp_regread in SQL)

Number 3 is not essential but helps and has been SQL Server best practice for a decade or more. You'd have to use sp_OA% or a CLR function to read this in SQL.

gbn
sp_OA% require speical permissions and moreover as you say it is not essential, so as a first step I will just write in the documentation that it is desirable to have cluster size to 64k.
+1  A: 

The GetDiskFreeSpace Windows API call returns the sector_per_cluster and bytes_per_sector values. I think this function should be in Windows unit.

kd304
That will read the settings on the client machine, which may be different from the server box
Pawel Marciniak