
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2013 07:48 PM
I was wondering if it's possible to get the physical disk size of Windows computers. I need to feel a form automatically and I need this information, I can get for the volumes, or logical drives, but I need the harddisk size for this.
Thanks, wish a nice 2013 all!
Paulo
- Labels:
-
Archive

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2013 04:32 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2013 02:32 PM
For tblFloppy, the following expression should work:
Ceiling(tblFloppy.Size / 1024 / 1024 / 1024)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2013 01:08 PM
SELECT TOP (1000000) dbo.tblcomputers.ComputerUnique, dbo.tblComputersystem.Computername, dbo.tblADusers.Description AS CostCenter,
dbo.tblADusers.Department, dbo.tblADusers.Displayname, dbo.tblComputerSystemProduct.IdentifyingNumber AS SerialNumber, CONVERT(VarChar(10),
dbo.tblOperatingsystem.InstallDate, 105) AS InstalledDate, dbo.tblCompCustom.BarCode AS InventoryNumber, CONVERT(VarChar(10),
dbo.tblCompCustom.PurchaseDate, 105) AS PurchaseDate, dbo.tblCustom_PeacyComputerTypes.PeacyModel, CONVERT(VarChar(10),
dbo.tblCompCustom.Warrantydate, 105) AS WarrantyDate, dbo.tblCompCustom.OrderNumber, CONVERT(VarChar(10), DATEADD(year, 4,
dbo.tblCompCustom.PurchaseDate), 105) AS ReplacementDate, dbo.tblcomputers.Computer, dbo.web40CorrectMemory.Memory,
dbo.tblComputersystem.Manufacturer, dbo.tblFloppy.Size / 1024 / 1024 / 1024 AS DiskSize
FROM dbo.tblADusers INNER JOIN
dbo.tblCompCustom ON dbo.tblADusers.Username = dbo.tblCompCustom.Custom1 INNER JOIN
dbo.tblComputerSystemProduct ON dbo.tblCompCustom.Computername = dbo.tblComputerSystemProduct.Computername INNER JOIN
dbo.tblOperatingsystem ON dbo.tblCompCustom.Computername = dbo.tblOperatingsystem.Computername RIGHT OUTER JOIN
dbo.tblComputersystem ON dbo.tblCompCustom.Computername = dbo.tblComputersystem.Computername INNER JOIN
dbo.tblcomputers ON dbo.tblcomputers.Computername = dbo.tblCompCustom.Computername INNER JOIN
dbo.tblBIOS ON dbo.tblBIOS.Computername = dbo.tblOperatingsystem.Computername INNER JOIN
dbo.web40CorrectMemory ON dbo.tblcomputers.Computername = dbo.web40CorrectMemory.Computername INNER JOIN
dbo.tblFloppy ON dbo.tblcomputers.Computername = dbo.tblFloppy.Computername LEFT OUTER JOIN
dbo.tblCustom_PeacyComputerTypes ON dbo.tblComputersystem.Model = dbo.tblCustom_PeacyComputerTypes.Model
WHERE (dbo.tblComputersystem.Domainrole = '1') AND (dbo.tblFloppy.Name = N'\\.\PHYSICALDRIVE0')

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2013 12:48 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2013 12:28 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2013 12:24 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2013 09:05 PM
CAST(ROUND((dbo.tblFloppy.Size / 1024 /1024 /1024), 0) AS FLOAT)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2013 09:09 PM
BullGates wrote:
Thank you very much, how do I round it to GB? I've tried this but it crashes the SQL GUI:CAST(ROUND((dbo.tblFloppy.Size / 1024 /1024 /1024), 0) AS FLOAT)
try (untested)
Cast(Cast(tblFloppy.Size As bigint) / 1024 / 1024 As numeric) As [Total size]

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2013 08:00 PM
PS: happy new year
