SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 how to convert numbers?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

mqh7
Yak Posting Veteran

58 Posts

Posted - 10/08/2012 :  17:05:55  Show Profile  Reply with Quote
From the SCCM view called v_GS_LOGICAL_DISK I am retrieving the HD size and the available free disk space. How/where would I convert the returned numbers into a MB and/or GB format? I looked at the CONVERT function but it says "The CONVERT() function is a general function that converts an expression of one data type to another." and I want to keep it numbers....

tkizer
Almighty SQL Goddess

USA
37466 Posts

Posted - 10/08/2012 :  17:33:06  Show Profile  Visit tkizer's Homepage  Reply with Quote
Show us what it currently returns and what you want it to return, please.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

mqh7
Yak Posting Veteran

58 Posts

Posted - 10/08/2012 :  17:49:14  Show Profile  Reply with Quote
Here is an example of what it returns.

Computer Name Model Device ID Free Disk Space Actual Disk Size Description Primary Partition
84-pc-b67 HP Compaq 8200 Elite USDT PC C: 209763 228232 Local Fixed Disk 1

Go to Top of Page

tkizer
Almighty SQL Goddess

USA
37466 Posts

Posted - 10/08/2012 :  18:00:20  Show Profile  Visit tkizer's Homepage  Reply with Quote
And what do you want it to return instead?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

mqh7
Yak Posting Veteran

58 Posts

Posted - 10/08/2012 :  18:20:25  Show Profile  Reply with Quote
Instead of a number I wanted it to say "Free Disk Space = 45GB" Vs just a number (for management you see!!)
Go to Top of Page

tkizer
Almighty SQL Goddess

USA
37466 Posts

Posted - 10/08/2012 :  18:53:15  Show Profile  Visit tkizer's Homepage  Reply with Quote
'Free Disk Space = ' + CONVERT(varchar(10), SomeColumn) + 'GB'

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000