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.
Figure 1: Query
SELECT DBSERVERNAME server, tabid 
   FROM systables
   WHERE tabid <= 4;
Figure 2: Query result
 server           tabid

montague             1
montague             2
montague             3
montague             4

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.