Scenario Sometimes you need to gather the SQL instance details in a proper format such as Server Name, Instance, Service…