NameTypeDescription
@EnvirovarcharThe name of the environment as defined in dbo.ApplicationEnvironment.
@DistinctOnlybitReturns a distinct list of servers for the given application.
@ReturnSchema
bitReturns the schema and SP call to help with your own dev. See SchemaReturn.
@Help
bitReturns the link to online help.



Minion allows you to setup environments and tie them to servers.  This SP shows you the servers associated with a specific environment.




Distinct Results

If a server belongs to more than one environment and/or role for an application, it's easy to get dupes in the result set.

Under ordinary circumstances, when you're querying to audit an application's footprint, this is useful.  But when you're using this SP as a way to get a list of servers to run a collection or a query, then you'll likely need a distinct list so you don't query the servers more than once.

For example, you write your own collection to get info about all the servers in the HR app.  Rather than writing your own logic, you decide to use this SP to get the list of servers you want.  In this case you don't want dupes in the list.


Sample call:

--Return all servers in a given enviro.
EXEC [Servers].[ByEnviro] 'Prod';




Related Articles

SchemaReturn

Object - Stored Procedure: Servers.ByApp