Comparison between two sets of servers

Duchemin, Dominique 2,006 Reputation points
2022-01-05T00:57:22.823+00:00

Hello,

I need to compare to sets of servers and try to find out a SQL statement to do so:

Server Name, Operating System, Drive letter, Size, Free Space, % Free, Ram Size, Page Size, Virtual Memory

and if possible to display the results as:

on one line...

ServerA-Operating System-Drive-Size-Free Space-Ram Size-Page Size-Virtual Memory / ServerB-Operating System-Drive-Size-Free Space-Ram Size-Page Size-Virtual Memory

Order by Server Name starting by the 6th character

or on two lines
---------------------------------------------------------------------------------------------------------------------------ServerA-Operating System-Drive-Size-Free Space-Ram Size-Page Size-Virtual Memory
ServerB-Operating System-Drive-Size-Free Space-Ram Size-Page Size-Virtual Memory

with an Order by the name character starting in position 6?

Thanks,
Dom

SQL Server | Other
{count} votes

Accepted answer
  1. CathyJi-MSFT 22,396 Reputation points Microsoft External Staff
    2022-01-05T03:02:16.657+00:00

    Hi Dom,

    No, it is not possible to achieve your requirement by SQL server query. We can use SQL query to get the information about SQL server. Such as the memory that currently be allocated to SQL server, etc.

    Your issue is more related to windows server, suggest you add windows-server tag, people there will give you a better help. Thanks for your understanding.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Duchemin, Dominique 2,006 Reputation points
    2022-01-05T03:32:11.66+00:00

    Thanks for the information,

    I was able to do a query which allow something close to our needs.

    Select SYS.Name0, SYS.Build01,
    LDISK.Caption0, LDISK.DeviceID0,
    LDISK.Size0, LDISK.FreeSpace0,
    MEM.TotalPageFileSpace0, MEM.TotalPhysicalMemory0, MEM.TotalVirtualMemory0
    From v_R_System SYS
    Join v_GS_LOGICAL_DISK LDISK on LDISK.ResourceID = SYS.ResourceID
    Join v_GS_X86_PC_MEMORY MEM on MEM.ResourceID = SYS.ResourceID
    Where
    SYS.Name0 like 'SSP3M%'
    or SYS.Name0 like 'SIP3M%'
    Order by LDISK.DeviceID0,substring(SYS.Name0, charindex('3M',SYS.Name0)+1, len(SYS.Name0)),substring(SYS.Name0, charindex('S',SYS.Name0)+1, len(1))

    Blockquote

    Thanks,
    Dom

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.