_______________________________________________________________________________________
Note: This e-mail is subject to the disclaimer contained at the bottom of this message. _______________________________________________________________________________________ How about something like... select Netbios_Name0 as 'Server Name' , Description0 , (convert(char(3), (InitialSize0/1024)/1024)) + 'GB' as ' Page File Initial Size' , (convert(char(3), (MaximumSize0/1024)/1024)) + 'GB' as 'Page File Max Size' , (convert(char(3), (TotalPageFileSpace0/1024)/1024)) + 'GB' as ' Page File Initial Size' , (convert(char(3), (TotalPhysicalMemory0/1024)/1024)) + 'GB' as 'Total Physical Memory' From v_R_System VRS Join v_GS_PAGE_FILE_SETTING PFILE on PFILE.ResourceID = VRS.ResourceID JOIN v_GS_X86_PC_MEMORY MEM on MEM.ResourceID = VRS.ResourceID ________________________________ MAGNUS TVETEN PLEASE CONSIDER THE ENVIRONMENT BEFORE PRINTING THIS EMAIL. ________________________________ From: [email protected] [mailto:[email protected]] On Behalf Of Dzikowski, Michael Sent: Saturday, 4 January 2014 7:04 AM To: [email protected] Subject: [mssms] RE: SQL query question - convery to GB or MB Ya! That got me where I need to go....simply just add the /1048576 or /1073741824 How could I add a GB or MB after the returned value? To show like 32 GB? From: [email protected]<mailto:[email protected]> [mailto:[email protected]] On Behalf Of Linkey, Mike Sent: Friday, January 03, 2014 3:00 PM To: [email protected]<mailto:[email protected]> Subject: [mssms] RE: SQL query question - convery to GB or MB I am not in front of a SQL server, but I think this will get you MB. select Netbios_Name0 as 'Server Name', Description0, InitialSize0*1024 as ' Page File Initial Size', MaximumSize0*1024 as 'Page File Max Size', TotalPageFileSpace0*1024 as 'Total Page File Space', TotalPhysicalMemory0*1024 as 'Total Physical Memory' From v_R_System VRS Join v_GS_PAGE_FILE_SETTING PFILE on PFILE.ResourceID = VRS.ResourceID JOIN v_GS_X86_PC_MEMORY MEM on MEM.ResourceID = VRS.ResourceID From: [email protected]<mailto:[email protected]> [mailto:[email protected]] On Behalf Of Dzikowski, Michael Sent: Friday, January 03, 2014 1:56 PM To: [email protected]<mailto:[email protected]> Subject: [mssms] SQL query question - convery to GB or MB How can I convert the results from this query to show in MB or GB? select Netbios_Name0 as 'Server Name', Description0, InitialSize0 as ' Page File Initial Size', MaximumSize0 as 'Page File Max Size', TotalPageFileSpace0 as 'Total Page File Space', TotalPhysicalMemory0 as 'Total Physical Memory' From v_R_System VRS Join v_GS_PAGE_FILE_SETTING PFILE on PFILE.ResourceID = VRS.ResourceID JOIN v_GS_X86_PC_MEMORY MEM on MEM.ResourceID = VRS.ResourceID [cid:[email protected]] I saw John Nelson has a post on this, but was wondering if there was a different way: http://myitforum.com/myitforumwp/2011/11/02/sql-function-convert-bytes-to-kb-mb-gb-tb-pb-or-eb-and-format-the-output-to-human-readable-format/ Mike D- _______________________________________________________________________________________ The information transmitted in this message and its attachments (if any) is intended only for the person or entity to which it is addressed. The message may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information, by persons or entities other than the intended recipient is prohibited. If you have received this in error, please contact the sender and delete this e-mail and associated material from any computer. The intended recipient of this e-mail may only use, reproduce, disclose or distribute the information contained in this e-mail and any attached files, with the permission of the sender. This message has been scanned for viruses. _______________________________________________________________________________________
<<inline: image001.png>>

