The DBSERVERNAME and SITENAME functions
You can include the function DBSERVERNAME (or its synonym, SITENAME) in a SELECT statement to find the name of the database server. You can query the DBSERVERNAME for any table that has rows, including system catalog tables.
In
the following query, you assign the label server to the DBSERVERNAME expression
and also select the tabid column from the systables system
catalog table. This table describes database tables, and tabid is
the table identifier.
The WHERE clause restricts the numbers of rows displayed. Otherwise, the database server name would be displayed once for each row of the systables table.